First programs
What a program is, how Python stores values, how it does arithmetic, and how to read input and show results neatly.
About 7 hours of study
Learning objectives
- Write programs that read input and print results
- Store and update values in variables
- Predict the result of arithmetic expressions
- Format output for people to read
Lessons
- 1
Your first program
Print text and numbers, write comments, and watch Python run from top to bottom.
- 2
Variables and assignment
Store values in names, update them, and see what Python does at each line.
- 3
Numbers and operators
Add, divide, find remainders and powers, and learn which operator Python works out first.
- 4
Input and type conversion
Read what the user types, turn text into numbers, and print neat results with f-strings.
- 5
Formatting output
Line up columns, round numbers and add separators with f-string format codes.
Module practice
- A name cardEasy
- A date with dashesMedium
- A small reportHard
- Add two numbersEasy
- Swap two wordsEasy
- Move every value alongMedium
- A running balanceHard
- Area and perimeterEasy
- Celsius to FahrenheitEasy
- Seconds to days and hoursMedium
- Paying with the fewest notesMedium
- What time will it be?Hard
- Average of threeEasy
- GreetingEasy
- Price with taxMedium
- Split the billHard
- A receipt lineEasy
- A score lineMedium
- A three-line invoiceHard