Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # made for testing http://pythontutor.com/
- # derived from the example at http://pythontutor.com/ on 2012-Oct.-02
- # exceeds instruction limit when n>46
- n = 46
- def listMake(length):
- r = None
- c = length
- while 0 < c:
- r = ( c, r )
- c = c - 1
- return r
- def listSum(numbers):
- r = 0
- q = numbers
- while q:
- (p,q) = q
- r = r + p
- return r
- myList = listMake(n)
- total = listSum(myList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement