Coding/Python Curriculum/Beginner Python
Beginner Course  ·  Grade 4 and up

Hello, Python!

Learn to code with fun stories, animals, games, and emojis. No experience needed — if you can type, you can code! Lesson 1 is open to everyone; create a free account and all six lessons open, with your progress saved.

6 Fun Lessons
Grade 4 and up
Free with a free account
▶ Run Code Right Here!
Getting Python ready… just a few seconds!
HOW IT WORKS Click inside any code box to edit it, change things around, then hit ▶ Run to see what happens!
⭐
About This Course
Duration
6 lessons
Grades
Grade 4 and up
Format
Self-paced, in your browser
Cost
Free
Level
Beginner 🌱

In this course you'll learn to talk to computers using Python — one of the most popular coding languages in the world! We'll use fun examples with animals, games, food, and stories. Every lesson has code you can run and change yourself right here on this page.

✅ No experience needed! If you can type on a keyboard and follow simple instructions, you're ready. We start from absolute zero.
🗺️
Your Learning Journey
🐍
🔢
❓
🔁
📦
🎮
🎯
What You'll Learn
🖨️ Print messages to screen
📦 Store info in variables
🔢 Do math with Python
❓ Make decisions with if/else
🔁 Repeat things with loops
🎮 Build your first game!
LESSON 01
Meet Python!
print, variables, and strings
▾
  • Use print() to display messages on screen
  • Understand what a variable is and how to create one
  • Work with text (called strings) and numbers
  • Combine text and variables together
  • Ask questions with input() and use the answers
Part 1 — Your First Python Program
What is print()?
print() tells Python to show something on the screen. Whatever you put inside the parentheses gets displayed. Text goes inside quotes: print("Hello!"). Python runs your program from the top line to the bottom, one line at a time. Lines that start with # are comments: notes for people, Python skips them.
Example 1.1 — Hello World! change the message → ▶ Run
🧪 Try it
  1. Change "Hello, World!" so it says hello to your best friend, then press ▶ Run.
  2. Add a new line at the bottom: print("My favorite color is blue"), with your own color.
  3. Delete one of the quote marks " and Run. Meet your first error message! The 🐞 box further down explains it. Put the quote back.
Part 2 — Variables: Boxes for Information
What is a variable?
A variable is like a labeled box 📦. You put a value inside and give it a name. Later you can use that name to get the value back. my_age = 10 means "put 10 in the box called my_age". Names use small letters and underscores, no spaces: my_pet, not my pet. Change my_name to your actual name!
Example 1.2 — Variables change my_name to YOUR name → ▶ Run
🧪 Try it
  1. Put in your own name, age and pet, and Run.
  2. In the last line, change my_age + 5 to my_age + 10. How old will you be?
  3. Add a new variable my_city = "Boston" (your own city) and a line that prints it.
Part 3 — Strings: Working with Text
Text and numbers
Text in quotes is called a string: "penguin". Numbers have no quotes: 10. You can glue strings together with +, but not a string and a number: turn the number into text first with str(my_age). The easiest way is an f-string: put an f before the quote and the variable in curly brackets, like f"I am {my_age} years old".
Example 1.3 — Fun with Text try your own words → ▶ Run
🧪 Try it
  1. Change "penguin" to your favorite animal. Does the letter count change?
  2. Make it laugh 100 times: print("Ha" * 100).
  3. Try print(animal.lower()) and print(animal.title()). What do they do?
Part 4 — Talking to Python: input()
Python can ask you questions
input("What is your name? ") shows the question, waits for you to type an answer, and gives the answer back so you can keep it in a variable: name = input("What is your name? "). When you press ▶ Run, a small box pops up for each question. What you type is always text, even a number: you will learn how to do math with it in lesson 2.
Example 1.4 — Chat with Python ▶ Run, then answer the questions
🧪 Try it
  1. Run it and give silly answers. Python believes everything!
  2. Add a third question: pet = input("What pet would you like? "), and a line that prints it.
  3. Make Python repeat your food three times with food * 3.
🐞 When it goes wrong
SyntaxError: unterminated string literal
A quote mark is missing. Every piece of text needs a quote at the start and at the end: "hello".
NameError: name 'my_nme' is not defined
Python does not know that name, usually because of a spelling mistake. Names must match exactly, capital letters too.
TypeError: can only concatenate str (not "int") to str
You glued text and a number with +. Use str(my_age), or an f-string: f"I am {my_age}".
✅ What you learned
  • print() shows things on the screen, top line first.
  • A variable is a named box: my_age = 10.
  • Text needs quotes and is called a string. Join strings with +, or use an f-string.
  • .upper() and len() change and measure strings.
  • input() asks a question and gives back the answer as text.

New words: comment, variable, string, f-string, input, error message

Lesson 1 Challenges

Each challenge has its own code box: change the code, press ▶ Run to see it work, then ✓ Check. When the four numbered challenges pass, the lesson is done. The warm-up and the ⭐ star challenge are extras: try the warm-up first if you like, and the star when you want something harder.

Warm-up What does this print? Count carefully!

Predictwhat will it print? → ✓ Check

Challenge Introduce yourself. Change my_name, my_age and my_pet to your own, and keep every sentence working.

Change itchange the code → ▶ Run → ✓ Check

Challenge Add a new variable my_favorite_food and print a sentence that uses it.

Change itchange the code → ▶ Run → ✓ Check

Challenge Read the code and predict the two lines it prints. Think about what .upper() and len() do.

Predictwhat will it print? → ✓ Check

Challenge This program has a bug: Python can't glue text and a number together. Fix it so it prints I am 9 years old.

Fix the bugfind the bug → ▶ Run → ✓ Check

⭐ Star challenge Robot greeter 🤖: ask for a name with input(), then greet in capitals. If the answer is Mia, it prints HELLO, MIA!

Build itwrite it → ▶ Run → ✓ Check
🧪 Lesson 1 Sandbox — Make It Yours! edit freely → ▶ Run → copy to save
This is YOUR space to experiment! Change anything, break things, try stuff. You can't break it — just click Run again
LESSON 02
Numbers & Math
arithmetic, calculations, and number tricks
▾
Lesson 2 opens with a free account.Beginner Python is free. Create an account, no payment needed, and all 6 lessons open, with your progress saved in the Student Portal. Already have an account? Sign in and open this page from the portal.
LESSON 03
Making Decisions
if, elif, else — teaching Python to choose
▾
Lesson 3 opens with a free account.Beginner Python is free. Create an account, no payment needed, and all 6 lessons open, with your progress saved in the Student Portal. Already have an account? Sign in and open this page from the portal.
LESSON 04
Loops & Repetition
for loops, while loops, and range()
▾
Lesson 4 opens with a free account.Beginner Python is free. Create an account, no payment needed, and all 6 lessons open, with your progress saved in the Student Portal. Already have an account? Sign in and open this page from the portal.
LESSON 05
Lists & Collections
storing and working with groups of things
▾
Lesson 5 opens with a free account.Beginner Python is free. Create an account, no payment needed, and all 6 lessons open, with your progress saved in the Student Portal. Already have an account? Sign in and open this page from the portal.
LESSON 06
Build Your Own Game!
functions + everything combined
▾
Lesson 6 opens with a free account.Beginner Python is free. Create an account, no payment needed, and all 6 lessons open, with your progress saved in the Student Portal. Already have an account? Sign in and open this page from the portal.

You finished Beginner Python

Keep going with Intermediate Python and Python4Physics: twelve lessons, $29 a month, start with either, each lesson opening as you finish the one before, at your own pace.

Subscribe, $29 a month Full curriculum