We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2f4c30 commit 9c4f5d0Copy full SHA for 9c4f5d0
ex33.py
@@ -1,14 +1,17 @@
1
-i = 0
2
-numbers = []
+def add_numbers(max):
+ i = 0
3
+ numbers = []
4
+ while i < max:
5
+ print "At the top i is %d" % i
6
+ numbers.append(i)
7
-while i < 6:
- print "At the top i is %d" % i
- numbers.append(i)
8
+ i = i + 1
9
+ print "Numbers now: ", numbers
10
+ print "At the bottom i is %d" % i
11
- i = i + 1
- print "Numbers now: ", numbers
- print "At the bottom i is %d" % i
12
+ return numbers
13
14
+numbers = add_numbers(10)
15
16
print "The numbers: "
17
0 commit comments