Week 2 — Variables, Data Types & Expressions
Welcome to your Week 2 Start Here page.
Why this matters
A nursing student converting a dose and a business major splitting a budget both need named values, the right types, and arithmetic they can trust.
In plain language
A program needs a way to remember a value and use it again. This week you give values names, called variables (names that hold values), and you learn that every value has a data type (the kind of value it is, such as a whole number or a piece of text). You will write expressions (combinations of values and operators that Python works out to one value) and learn the order Python uses to work them out. You will also see why dividing can give three different answers, and how to turn text into a number on purpose. As always, you predict what each line prints and then run it to check.
- Already covered: Week 1, print, precedence, and error types.
- This week: variables, types, three divisions, and conversion.
- How they connect: last week's traces get names to live in.
- Where we're going next: Week 3, Input, Output & Strings.
Focus
How does a program remember a value and do math with it?
By the end of this module, you should be able to:
- [ ] predict what a reassignment changes
- [ ] choose between /, //, and % for a question
- [ ] convert text to a number before adding
To-do
Plan your week
- Read Chapter 2 (about 40 minutes), then the lecture and slides.
- Work the lecture tutorial (60–90 minutes) and the practice set (about 20 minutes).
- Do the Coding Lab (about 90 minutes), the discussion, and the assignment.
- Take the quiz.
This week's checkpoint: divide 255 pages by 30 three ways and say what each result means.
You've got this
Predict, then run, and ask your instructor if a step snags.
Built with The Course Maker · samples.thecoursemaker.com