Intro to Python
Beginner
About Python →
f-strings, lists, loops and functions. 25 bite-size lessons.
0 / 25 lessons complete
Start Lesson 1
Open the Python sandbox ↗
1
Hello, World!
Make the computer say hello, every programmer's first program.
2
Variables
Store a value in a variable and print it.
3
Numbers
Store numbers and add them together.
4
Doing Maths
Try all four maths operators.
5
Joining Strings
Glue two pieces of text together with +.
6
f-strings
Drop variables straight into text, the modern Python way.
7
Asking for Input
Ask the user a question and use their answer.
8
Booleans
Create a True/False value.
9
If Statements
Only run code when a condition is true.
10
Else
Do one thing when true, another when false.
11
Elif
Check several conditions, one after another.
12
The or Keyword
Combine conditions with or.
13
The and Keyword
Combine conditions with and.
14
Lists
Store several values in one variable.
15
List Indexes
Pick single items out of a list.
16
Growing Lists
Add to a list and count its items.
17
For Loops
Visit every item in a list, one by one.
18
Counting with range()
Loop a set number of times.
19
Adding It Up
Total up all the numbers in a list.
20
While Loops
Count down to lift-off with while.
21
Break
Escape from a loop with break.
22
Continue
Skip one trip around a loop with continue.
23
Functions
Write your own function and call it twice.
24
Function Inputs
Give a function information to work with.
25
Roll a Six
Grand finale: keep rolling a dice until you get a 6.