Python quizzes

A quiz for every lesson: predict the output, spot the bug, put the lines in order or write a little code. Every answer is explained, and each attempt picks fresh questions.

31 quizzes · scores are kept in this browser · 70% passes and completes the lesson

Python Mastery Quiz Questions from every topic, at the level and length you choose. Your best each day earns XP.

Part 1 Python Basics

  1. 1 Hello World quiz 10 questions from a pool of 98, about 8 min
  2. 2 Variables and Types quiz 12 questions from a pool of 107, about 9 min
  3. 3 Numbers and Math quiz 15 questions from a pool of 105, about 12 min
  4. 4 Strings quiz 12 questions from a pool of 105, about 9 min
  5. 5 String Methods quiz 12 questions from a pool of 105, about 9 min
  6. 6 User Input quiz 10 questions from a pool of 98, about 8 min
  7. 7 Booleans and Comparisons quiz 10 questions from a pool of 104, about 8 min
  8. 8 if/elif/else quiz 12 questions from a pool of 105, about 9 min

Part 2 Python Collections and Loops

  1. 9 Lists quiz 15 questions from a pool of 106, about 12 min
  2. 10 Tuples quiz 12 questions from a pool of 104, about 9 min
  3. 11 Dictionaries quiz 12 questions from a pool of 105, about 9 min
  4. 12 Sets quiz 12 questions from a pool of 104, about 9 min
  5. 13 For Loops quiz 15 questions from a pool of 104, about 12 min
  6. 14 While Loops quiz 12 questions from a pool of 104, about 9 min
  7. 15 List Comprehensions quiz 10 questions from a pool of 104, about 8 min

Part 3 Python Functions

  1. 16 Functions quiz 12 questions from a pool of 47, about 9 min
  2. 17 Function Arguments quiz 12 questions from a pool of 48, about 9 min
  3. 18 Scope quiz 10 questions from a pool of 46, about 8 min
  4. 19 Lambda, map() and filter() quiz 12 questions from a pool of 48, about 9 min
  5. 20 Recursion quiz 12 questions from a pool of 48, about 9 min

Part 4 Working with Code and Data

  1. 21 Errors and Exceptions quiz 12 questions from a pool of 49, about 9 min
  2. 22 Modules and Imports quiz 12 questions from a pool of 49, about 9 min
  3. 23 File Handling quiz 15 questions from a pool of 49, about 12 min
  4. 24 String Formatting quiz 15 questions from a pool of 50, about 12 min
  5. 25 Dates and Times quiz 12 questions from a pool of 47, about 9 min

Part 5 Object-Oriented Python

  1. 26 Classes and Objects quiz 12 questions from a pool of 49, about 9 min
  2. 27 Inheritance quiz 12 questions from a pool of 47, about 9 min
  3. 28 Special Methods quiz 12 questions from a pool of 47, about 9 min

Part 6 Going Further

  1. 29 Iterators and Generators quiz 12 questions from a pool of 47, about 9 min
  2. 30 Decorators quiz 12 questions from a pool of 47, about 9 min
  3. 31 Type Hints quiz 12 questions from a pool of 48, about 9 min