Python Quizzes for Beginners | SpacePython

Each quiz is a handful of questions on one topic. The questions use the same examples as our articles. Instead of abstract foo and bar, you'll work out the distance to the Moon, convert star temperatures to kelvins and figure out how much you'd weigh on Jupiter. After every answer you get a short explanation of why it's right, or why it isn't.

When should you take a quiz?

Right after reading the article on a topic is a good time, while it's still fresh. A few days later is even better, because that's when you find out what you actually remember. Getting a question wrong costs nothing. Better to make the mistake here than in code that calculates fuel for the trip home.

Python Basics Quiz

Free Python quiz for beginners: 20 multiple-choice questions on print(), strings, lists, dictionaries, loops and functions, with instant answers.

  • Questions: 20
  • Easy

Python print() Quiz

Free quiz on Python's print() function: 15 questions on quotes, escape characters, sep, end, flush and f-string formatting, with instant answers.

  • Questions: 15
  • Easy

Python Variables Quiz

Free beginner quiz on Python variables: 15 questions on naming, assignment, data types, type conversion and scope, with instant answers.

  • Questions: 15
  • Easy

Python Data Types Quiz

Free beginner quiz on Python data types: 15 questions on int, float, str, bool, None, lists, tuples, dictionaries and sets, with instant answers.

  • Questions: 15
  • Easy

Python Math Operations Quiz

Free beginner quiz on math in Python: 15 questions on +, -, *, /, //, %, **, operator precedence and rounding, with instant answers.

  • Questions: 15
  • Easy

Python Strings Quiz

Free beginner quiz on Python strings: 15 questions on joining, indexing, slicing, len(), split(), join() and string methods, with instant answers.

  • Questions: 15
  • Easy

Python If/Else Quiz

Free beginner quiz on Python if, elif and else: 15 questions on conditions, comparison and logical operators and indentation, with instant answers.

  • Questions: 15
  • Easy

Python For Loop Quiz

Free beginner quiz on Python for loops: 15 questions on lists, strings, range(), enumerate(), totals and break, with instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python While Loop Quiz

Free beginner quiz on Python while loops: 15 questions on conditions, counters, infinite loops, break and continue, with instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Lists Quiz

Free beginner quiz on Python lists: 15 questions on indexing, slicing, append, insert, pop, remove, sorting and copying, with instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Dictionaries Quiz

Free beginner quiz on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Tuples Quiz

Free beginner quiz on Python tuples: 15 questions on indexing, packing and unpacking, count(), index(), slicing and nested tuples. Instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Sets Quiz

Free beginner quiz on Python sets: 15 questions on creating sets, add(), update(), remove(), union, intersection, difference and subsets. Instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Functions Quiz

Free beginner quiz on Python functions: 15 questions on def, return, arguments, default values, *args, scope and docstrings. Instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Return Values Quiz

Free beginner quiz on Python return values: 15 questions on return, None, several values, lists, dictionaries and early exit. Instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python *args and **kwargs Quiz

Free beginner quiz on Python *args and **kwargs: 15 questions on extra arguments, tuples, dictionaries, and * and ** in calls. Instant answers.

  • Questions: 15
  • Easy
  • Logged-in only

Python Variable Scope Quiz

Free beginner quiz on Python variable scope: 15 questions on local and global variables, the global and nonlocal keywords, and nested functions.

  • Questions: 15
  • Easy
  • Logged-in only

Python Type Conversion and input() Quiz

Free beginner quiz on Python type conversion and input(): 15 questions on int(), float(), str(), bool() and reading numbers from the user.

  • Questions: 15
  • Easy
  • Logged-in only

Python Error Messages Quiz

Free beginner quiz: 15 Python errors to read and fix – NameError, TypeError, ValueError, IndexError, KeyError, IndentationError and ZeroDivisionError.

  • Questions: 15
  • Easy
  • Logged-in only