Lesson 14
Python variables and basic calculations
Big question
How does Python remember values and calculate with them?
Lesson progress
Complete checkpoints as you learn
0% complete0 checkpoint streak
Big question
Concept
Activity
Quiz
Learning objectives
- Explain python variables and basic calculations in plain language.
- Use assignment correctly in an interpretation.
- Connect the lesson idea to a formula, graph, Python result, or real example.
Simple explanation
A Python variable stores a value under a name. Once stored, that value can be used in calculations, printed, or combined with other values.
Key terms
- Assignment
- Giving a value to a name using the equals sign.
- Variable name
- The label Python uses to refer to a stored value.
- Expression
- A calculation that produces a value.
- A command that displays output.
Calculation pattern
Example
If hourly wage is 20 and hours are 35, weekly earnings are 20 times 35.
Calculate weekly earnings
1hourly_wage = 202hours = 353weekly_earnings = hourly_wage * hours4print(weekly_earnings)Checkpoint activity
Pause and explain this lesson's main idea in your own words before moving forward.
Try it yourself
Write one plain-English sentence explaining the main idea from this lesson.
Common mistakes
Check these before you move on.
A regression coefficient describes a pattern unless the assumptions or research design support a causal interpretation.
Quick quiz
What does hourly_wage = 20 do in Python?
Key takeaway
Python variables make calculations readable and reusable.