TutreNews Learn

Python Fundamentals

Learn to program with Python from scratch: values and variables, decisions, loops, lists, dictionaries, strings, functions and error handling. Every code example and exercise in this course is executed and verified automatically.

Beginner · 4 units · 12 lessons · 84 exercises · ~1.8 h

What you will learn

  • Read and predict the output of small Python programs
  • Use variables, arithmetic, conditions and loops
  • Store and process data with lists, dictionaries and strings
  • Write reusable functions with parameters and return values
  • Find and fix common bugs and handle errors with try/except

Prerequisites

  • No programming experience needed

Learning path

1 First steps

  1. Your first program6 min · 5 exercises
  2. Variables and types8 min · 5 exercises
  3. Arithmetic8 min · 5 exercises
  4. Unit exam5 exercises

2 Decisions and loops

  1. if, elif, else9 min · 5 exercises
  2. while loops8 min · 4 exercises
  3. for loops and range9 min · 5 exercises
  4. Unit exam5 exercises

3 Lists, dictionaries, strings

  1. Lists10 min · 5 exercises
  2. Dictionaries9 min · 4 exercises
  3. Working with strings9 min · 5 exercises
  4. Unit exam5 exercises

4 Functions and errors

  1. Defining functions10 min · 5 exercises
  2. Scope and default values9 min · 4 exercises
  3. Handling errors10 min · 4 exercises
  4. Unit exam5 exercises
  1. Final exam8 exercises

Practical project: Vocabulary quiz in the terminal

Build a small quiz program (run it locally with python3 quiz.py):

  1. Store 10 word pairs in a dictionary (English → German).
  2. Loop over the dictionary, ask with input(), compare case-insensitively with .strip().lower().
  3. Count correct answers and collect mistakes in a list.
  4. At the end print the score as a percentage with an f-string ({pct:.0f}%) and repeat only the mistakes.
  5. Put the quiz logic in a function run_quiz(pairs) that returns the list of mistakes.

Extension: load the word pairs from a text file and handle FileNotFoundError.

References

Related courses