Do Now 2.06
1. In your Notebook
Answer the following
- How would you print out something 10 times? What about 100? What about 1,000?
- Can you remember something from Snap! that might allow that?
2. Open up the console
Type the following code using interactive mode
while True:
print('a')
3. In your Notebook
Write responses for the following
- What happens when you run this code?
-
Try using other Boolean expressions instead of
True(e.g.4 > 5and9 != 2), and explore what happens. -
How would you print out something 10 times? What about 100? What about 1,000?
- Can you remember something from Snap! that might allow that?
4. Open up the console
Type the following code
while True:
print('a')
5. In your Notebook
continue responses for the following
- What happens when you run this code?
- Try using other Boolean expressions instead of
True(e.g.4 > 5and9 != 2), and explore what happens.
6. Open up the console
Type and run the following code (Remember this from Unit 2?)
if animal in ['cat', 'dog']:
print("A great pet!")