Learning path

Python from zero

From print() and variables to conditions, loops, strings, collections, functions, files and classes, with a challenge after each topic.

25 lessons · 59 challenges

Start the path →

1 Getting started 4 lessons

  1. Lesson 1 challenge Hello World in Python Write your first Python program and print text with print().
  2. Lesson 2 challenges Variables and Data Types in Python Store values in variables and learn Python's basic types: str, int, float and bool.
  3. Lesson 4 challenges Numbers and Operators in Python Do arithmetic in Python with +, -, *, /, //, % and **, and compare values.
  4. Lesson 1 challenge User Input in Python Read what the user types with input() and convert it to a number.

2 Making decisions 2 lessons

  1. Lesson 3 challenges If Else in Python Make decisions with if, elif and else, and combine conditions with and, or and not.
  2. Lesson 3 challenges Even or Odd in Python Determine whether an integer is even or odd.

3 Loops 3 lessons

  1. Lesson 3 challenges For Loop in Python Learn Python for loops with range, enumerate, and a runnable example.
  2. Lesson 4 challenges While Loop in Python Run a Python while loop and learn how its condition controls repetition.
  3. Lesson 3 challenges Multiplication Table in Python Print the first five multiples of a number.

4 Strings and text 3 lessons

  1. Lesson 3 challenges Strings in Python Work with text in Python: length, indexing, slicing and string methods.
  2. Lesson 3 challenges String Formatting in Python Build readable output with Python f-strings and format specifiers.
  3. Lesson 3 challenges Palindrome in Python Check whether text is a palindrome using Python string operations.

5 Collections 5 lessons

  1. Lesson 4 challenges List in Python Create, update, filter, and iterate over a Python list.
  2. Lesson 2 challenges Tuple in Python Group values in a tuple, unpack them and return several values from a function.
  3. Lesson 1 challenge Set in Python Keep unique values with a Python set and combine sets with union and intersection.
  4. Lesson 3 challenges Dictionary in Python Create, update, and iterate over a Python dictionary.
  5. Lesson 3 challenges List Comprehension in Python Transform and filter values with a Python list comprehension.

6 Functions 3 lessons

  1. Lesson 3 challenges Function in Python Define and call a Python function with parameters and a return value.
  2. Lesson 1 challenge Modules and Imports in Python Use Python's standard library with import, from ... import and aliases.
  3. Lesson 2 challenges Fibonacci in Python Generate the Fibonacci sequence in Python and run the code online.

7 Errors and files 3 lessons

  1. Lesson 2 challenges Try Except in Python Handle invalid input with Python try, except, and finally.
  2. Lesson 1 challenge File Handling in Python Write, append and read text files in Python with open() and with.
  3. Lesson 2 challenges Read and Write JSON in Python Convert between JSON text and Python dictionaries.

8 Objects and classes 2 lessons

  1. Lesson 1 challenge Class and Object in Python Define a Python class, create an object, and call an instance method.
  2. Lesson 1 challenge Object-Oriented Programming in Python Learn encapsulation, inheritance, method overriding, and polymorphism with a runnable Python OOP example.
Continue with: Programming fundamentals