Learn Python the Hard Way Exercise 32-33: For loops, lists, and while loops.
How would you print out a list (called numbers) in list format?
print(numbers)
What would a for loop of for i in range(1, 3): print(i) output and why?
1, 2 because python is exclusive, not inclusive unless specified
What are the general rules for while loops?
1. In general, try and use a for loop 2. Make sure that you have a false condition 3. When in doubt print the test variable at the top/bottom of the loop
What can we add to lists?
Chars, strings, or numbers
What's the difference between a for loop and a while loop?
a for loop can only iterate over a specific collection of things, a while loop can do any kind of looping you want.
How do we adding numbers 0 - 5 to the empty list elements?
for i in range(0, 6): elements.append(i)