Permalink
Browse files

extra credit - added step option to add_numbers function

  • Loading branch information...
mwarkentin committed Jan 17, 2011
1 parent 9c4f5d0 commit 84e8a351a7c5534901c5ff4703e781d4657ae6aa
Showing with 3 additions and 3 deletions.
  1. +3 −3 ex33.py
View
@@ -1,17 +1,17 @@
def add_numbers(max):
def add_numbers(max, step=1):
i = 0
numbers = []
while i < max:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
i = i + step
print "Numbers now: ", numbers
print "At the bottom i is %d" % i
return numbers
numbers = add_numbers(10)
numbers = add_numbers(10, 5)
print "The numbers: "

0 comments on commit 84e8a35

Please sign in to comment.