Python Basics π
PythonLearn Python from scratch β read code, return values, do a little math, make choices, loop, and work with text. Real Python runs right in your browser, no install needed. One tiny, friendly step at a time.
Your progress
0/14 complete
- 1β‘ 10
Read Some Python π Quiz
Before you write Python, learn to read it.
- 2β‘ 15
Return a Word βοΈ
Your first Python β make a function hand back a word.
- 3β‘ 20
Use the Input π₯
A function can take a value in and hand it back.
- 4β‘ 25
Say Hello with an f-string π
Drop a value right into a sentence.
- 5β‘ 25
A Little Math βοΈ
Multiply two numbers together.
- 6β‘ 25
What's Left Over? β
Use % to find the remainder.
- 7β‘ 10
Making Choices π Quiz
How Python picks between two paths.
- 8β‘ 30
Red Light, Green Light π¦
Write your first if/else: stop or go?
- 9β‘ 30
A Third Choice with elif π’
Add a middle option with elif.
- 10β‘ 10
What's a Loop? π Quiz
See how Python repeats things before you write one.
- 11β‘ 35
Add Them Up with a Loop π
Write your first for loop.
- 12β‘ 30
SHOUT in Capitals π
Use .upper() to make text loud.
- 13β‘ 35
Tidy Up Text π§Ή
Trim spaces, then chain methods together.
- 14β‘ 40
Default Arguments βοΈ
Give a parameter a sensible default.