Loops and Variables
Readings
The readings for this week cover three topics. First, we will learn a bit more about strings and about the print() function, which outputs strings. We’ve been using both in class already. Second, we’ll learn about two kinds of loops – while loops and for loops. And third, we’ll learn a bit about using random numbers in Python.
Strings and Print()
- Automate the Boring Stuff, Chapter 6: Manipulating Strings – Stop reading at “Project: Password Locker”
- The print() function in Python – Stop reading at “Printing Custom Data Types”
Loops
- Loops in Python
- Learn Python: Loops - practice. Note the exercise at the end uses lists, which we won’t cover in class for a couple weeks.
Randomness
Summary
For the summary this week, focus on loops and randomness. Think about similar things you have encountered before.
Summary prompt: How would you describe loops and randomness in your own words, and what do you think each thing might be used for in programs?
Question
As per usual, your question can be one of three types:
- Confusion: what didn’t you understand in the readings?
- Curiousity: what do you want to know more about?
- Connection: how does this topic connect to your own experiences?
Submit your summary+question on D2L under Quizzes before class starts on Tuesday.