Learn Python for beginners with free lessons and browser-based coding puzzles. Start with Hello World, then learn variables, loops, lists, and functions.
your first win
Run one line of code, see the result immediately, and turn that first success into a tiny challenge.
print("Hello, World!")
# output
Hello, World!The path
Write one line of Python, see it print a greeting, then try your first puzzle.
Store values in variables and learn the basic kinds of data Python works with.
Do math, compare values, and combine conditions with Python's operators.
Slice and transform text, build messages with f-strings, and read values typed by the user.
Make your programs choose between different paths with if, elif, and else.
Repeat actions with while and for loops, and control them with break and continue.
Store ordered collections of values and learn to add, remove, sort, and loop over them.
Meet two more collection types: tuples for fixed groups of values and sets for unique items.
Store data as key-value pairs and look things up by name instead of by position.
Package code into reusable, named blocks with parameters and return values.