Learn Python
five minutes at a time.
Python is the friendliest first programming language: short, readable code that does real work in data, AI, automation and the web. It's the language we recommend if you've never coded before.
Start the Python course free60 lessons · about 11 hours · beginner friendly
Your first program
name = "Pebble"
print(f"Hello, {name}!")Output
Hello, Pebble!The Codiqo Python course starts at print() and takes you through variables, decisions, loops, lists, dictionaries, functions, files and classes, and ends with a habit-tracker project you build yourself.
How the Python lessons work
Learn in small steps
Each lesson explains one idea with worked examples, then asks you about it straight away. About five minutes each.
Write real code
Predict the output, fix the bug, fill the gap and build programs line by line. Every lesson ends with a short program you write yourself, and we run it for real.
Keep it going
Earn XP, open chests, climb weekly leagues and keep your streak alive, with Pebble the penguin cheering you on and Terry the mentor giving hints.
The full Python curriculum
Foundations
Variables, values, output, input and basic types.
First Steps: Write your first lines of Python and store values in variables.
- Hello, Python: Display text with print() and write strings with quotes
- Numbers and Arithmetic: Calculate with + - * / and see the results
- Variables: Store values under a name, reuse them and update them
- Types and Comments: Tell str, int, float and bool apart and explain code with comments
Text and Input: Work with strings and read what people type.
- Joining and Formatting Text: Join strings with + and insert values with f-strings
- Slicing and String Methods: Read characters by index, slice text and use upper(), strip() and replace()
- Reading Input: Read text with input() and convert it with int(), float() and str()
- Project: Tip Calculator: Combine input, conversion and formatted output in one program
Numbers and Logic: Integer maths, comparisons and True or False.
- Integer Maths and Precedence: Use // and %, predict the order of operations and update with +=
- Number Tools and Float Surprises: Use round(), abs(), min() and max() and see why 0.1 + 0.2 isn't exactly 0.3
- Booleans and Comparisons: Compare values and combine conditions with and, or and not
- Project: Eligibility Checker: Decide eligibility from several conditions
Logic and Repetition
Conditions, comparisons, loops and Boolean logic.
Making Decisions: Run different code depending on conditions.
- if and else: Run code only when a condition is true and provide an alternative path
- elif and Nested Conditions: Choose between several options and put decisions inside decisions
- Combining Conditions: Use and/or inside if statements and pick a value inline with x if cond else y
- Project: Grade Calculator: Convert scores into grades
Loops: Repeat work with while and for.
- while Loops and break: Repeat code while a condition is true and stop a loop safely
- continue and Input Checks: Skip iterations and keep asking until input is valid
- for Loops and range(): Loop over text and numbers with start, stop and step
- Running Totals and Nested Loops: Accumulate values in a loop and put loops inside loops
Loop Patterns: Classic patterns for solving problems with loops.
- Finding and Counting: Track a maximum, count matches and remember whether something was found
- enumerate() and Building Strings: Loop with both index and value and grow text inside a loop
- Tracing and Debugging Loops: Predict loop behaviour step by step and fix off-by-one errors
- Project: FizzBuzz: Solve the classic FizzBuzz problem
Data and Functions
Strings, collections, functions, parameters and return values.
Lists: Store and process ordered collections of values.
- Creating and Indexing Lists: Write list literals and read and change items by position
- Adding, Removing and Slicing: Use append(), insert() and remove() and copy parts of a list
- Looping and Sorting Lists: Process every item and use sort(), sorted() and len()
- Project: To-Do List: Manage a list of tasks
Collections: Tuples, sets and dictionaries.
- Tuples and Sets: Group fixed values together and store unique values
- Dictionaries: Map keys to values and loop with keys(), values() and items()
- Nested Data: Combine lists and dictionaries and choose the right structure for the job
- Project: Word Counter: Count word frequencies
Functions: Write reusable code with def.
- Defining Functions and Parameters: Write and call functions and pass information into them
- Return Values and Defaults: Send results back with return and give parameters default values
- Scope and Clean Design: Understand local and global variables and split problems into functions
- Project: Quiz Engine: Build a small quiz with functions
Applied Programming
Errors, files, modules, structured projects and problem-solving.
Errors and Files: Handle problems gracefully and keep data between runs.
- Reading Tracebacks: Find the cause of an error and recognise NameError, TypeError and ValueError
- try and except: Catch errors so programs keep running, raise your own and validate input
- Reading and Writing Files: Open, write and append to files safely with the with statement
- Project: Journal: Save and reload journal entries
Modules and Classes: Use the standard library and model things with objects.
- Importing Modules: Use import, random and datetime from the standard library
- Classes and Objects: Define a class with __init__ and create objects from it
- Methods and Attributes: Add behaviour and state to objects and control how they print with __str__
- Project: Bank Account: Model accounts with rules
Capstone Project: Plan and build a complete Python program.
- Planning and Modelling: Turn an idea into a plan and choose structures for the program
- Core Logic and Interaction: Implement the main logic and add a text interface
- Errors and Testing: Make the program robust and check behaviour with tests
- Polishing: Improve readability and output
Questions about the Python course
Is the Python course free?
Yes. All 60 Python lessons, practice sessions, leagues and achievements are free. Codiqo Plus is optional and adds unlimited Compile Fuel.
Is it good for complete beginners?
Yes. It starts from your very first line of Python and explains every idea before asking you about it. If you already know some Python, a quick check lets you skip ahead.
How long does it take?
About 11 hours in all: 60 lessons of roughly five to ten minutes, in 4 chapters of 3 units. Most learners do a lesson or two a day.
Do I need to install anything?
No. Codiqo works in your browser and on iPhone and Android. The programs you write run on our servers in a locked-down sandbox, so there's nothing to set up.
What will I build?
Every lesson ends with a short program you write yourself, and the course finishes with "Capstone Project": Plan and build a complete Python program.
Other courses
Learn JavaScript · Learn C · Learn C++ · Learn Java · Learn C#