Home › Learn by Playing › Skills › Python

Learn Python free, step by step

From your first line of code to classes, testing and pandas.

28 units · 251 cards · Basic → Intermediate → Advanced · free, no login

Start learning Python ▶

How it works

Try a few cards

💡 Learn

Variables hold values

A variable is a name for a value. = stores the value on the right in the name on the left, and print() shows values on screen. Names are case-sensitive: name and Name are different.

Try it

Which is a valid Python variable name?

  • 2total
  • total marks
  • total-marks
  • total_marks
Show the answer

✓ total_marks. Names can use letters, digits and _, but cannot start with a digit or contain spaces. - would mean minus.

Try it

What does print("5 + 3") show?

  • "5 + 3"
  • 5 + 3
  • 53
  • 8
Show the answer

✓ 5 + 3. Inside quotes it is text, so Python prints it exactly as written, without the quotes. print(5 + 3) would show 8.

Full syllabus

Basic · 10 units

  1. Print and variables
  2. Numbers and maths
  3. Strings
  4. Input and type conversion
  5. if / elif / else
  6. Lists
  7. for loops and range
  8. while loops
  9. Functions
  10. Dictionaries

Intermediate · 10 units

  1. Tuples and sets
  2. String methods and f-strings
  3. Errors and try/except
  4. Files (with open)
  5. Modules and pip
  6. List comprehensions
  7. Default args, *args, **kwargs
  8. Classes and objects
  9. Virtual environments
  10. JSON and CSV

Advanced · 8 units

  1. Iterators and generators
  2. Decorators
  3. Context managers
  4. Type hints
  5. Testing with pytest
  6. Async basics
  7. pandas for data
  8. Project structure and packaging

Start learning Python ▶

Kramavriddhi Learn is free and independent. Facts are checked against the official documentation. Badges are self-checks, not official certificates. Found a mistake or have an idea? Tell us.