Skip to content

Commit c44a97e

Browse files
committed
extra credit - replaced for loop with direct assignment
1 parent 7cf38cb commit c44a97e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ex32.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
elements = []
2020

2121
# then use the range function to do 0 to 20 counts
22-
for i in range(0, 6):
23-
print "Adding %d to the list." % i
24-
# append is a function that lists understand
25-
elements.append(i)
22+
elements = range(0, 6)
2623

2724
# now we can print them out too
2825
for i in elements:

0 commit comments

Comments
 (0)