- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
Python Quizzes
60 Python quizzes with 600 multiple-choice questions, from easy to hard. Every answer is explained.
60 quizzes · 600 questions
12 categories
Python 3.12
Python categories
4 Easy1 Medium
Variables & Data Types
Numbers & Operators
Booleans & Comparisons
+2
0 of 5 passed
Start
2 Easy2 Medium1 Hard
Indexing & Slicing
String Methods
String Formatting
+2
0 of 5 passed
Start
2 Easy2 Medium1 Hard
If / Elif / Else
For Loops & range()
While Loops
+2
0 of 5 passed
Start
2 Easy2 Medium1 Hard
List Basics
List Methods
Slicing Lists
+2
0 of 5 passed
Start
1 Easy3 Medium1 Hard
Dictionary Basics
Dictionary Methods
Looping over Dicts
+2
0 of 5 passed
Start
1 Easy2 Medium2 Hard
Defining Functions & return
Default & Keyword Arguments
*args and **kwargs
+2
0 of 5 passed
Start
1 Easy2 Medium2 Hard
enumerate, zip & sorted
List Comprehensions
Lambda, map & filter
+2
0 of 5 passed
Start
2 Easy1 Medium2 Hard
Classes & Objects
__init__ & self
Inheritance
+2
0 of 5 passed
Start
2 Easy2 Medium1 Hard
Reading Tracebacks
Common Errors
try / except / finally
+2
0 of 5 passed
Start
2 Easy2 Medium1 Hard
Modules & Imports
math & random
File Reading & Writing
+2
0 of 5 passed
Start
1 Easy2 Medium2 Hard
Python Interview Questions for Freshers
Output-Based Python Questions
Tricky Python Questions
+2
0 of 5 passed
Start
4 Medium1 Hard
Type Hints
Dataclasses & Enums
Context Managers & with
+2
0 of 5 passed
Start
matching quizzes
1
Variables & Data Types
Easy
Check how Python names, stores and types your values.
Python · Python Basics
#variables#types
10 questions · ~5 min
Not started
Start
2
Numbers & Operators
Easy
Test your grip on Python's math operators, from
/ to // and %.
Python · Python Basics
#operators#floor-division#modulo
10 questions · ~5 min
Not started
Start
3
Booleans & Comparisons
Easy
See if you know what Python treats as true, false and equal.
Python · Python Basics
#bool#truthiness#comparisons
10 questions · ~5 min
Not started
Start
4
Input, Output & f-strings
Easy
Practice printing, reading input and building text with f-strings.
Python · Python Basics
#print#input#f-strings
10 questions · ~5 min
Not started
Start
5
Type Conversion
Medium
Find out where
int(), float(), str() and round() surprise people.
Python · Python Basics
#casting#gotchas
10 questions · ~6 min
Not started
Start
1
Indexing & Slicing
Easy
Pick characters and substrings out of a string with indexes and slices.
Python · Strings
#indexing#slicing
10 questions · ~5 min
Not started
Start
2
String Methods
Easy
Test the everyday string methods like
split, join, strip and replace.
Python · Strings
#string-methods#split-join
10 questions · ~5 min
Not started
Start
3
String Formatting
Medium
Pad, align, round and group numbers with Python's format specs.
Python · Strings
#f-strings#formatting
10 questions · ~6 min
Not started
Start
4
Immutable Strings
Medium
Strings never change in place - see if you can predict what really happens.
Python · Strings
#immutability#output-prediction
10 questions · ~6 min
Not started
Start
5
Escape Characters & Raw Strings
Hard
Backslashes, raw strings and Unicode escapes - the interview-style string gotchas.
Python · Strings
#escapes#raw-strings#unicode
10 questions · ~8 min
Not started
Start
1
If / Elif / Else
Easy
Check how Python picks a branch with if, elif and else.
Python · Control Flow
#conditions#comparisons
10 questions · ~5 min
Not started
Start
2
For Loops & range()
Easy
Test how for loops walk through sequences and what range() really produces.
Python · Control Flow
#loops#range
10 questions · ~5 min
Not started
Start
3
While Loops
Medium
Trace while loops step by step and spot the ones that never stop.
Python · Control Flow
#loops#while
10 questions · ~6 min
Not started
Start
4
break, continue & loop else
Medium
Predict the output when loops are cut short, skipped or finished with else.
Python · Control Flow
#loops#output-prediction
10 questions · ~6 min
Not started
Start
5
Nested Loops & Patterns
Hard
Trace loops inside loops, star patterns and the classic interview traps.
Python · Control Flow
#nested-loops#patterns#interview
10 questions · ~8 min
Not started
Start
1
List Basics
Easy
Create lists, read items by index and change them in place.
Python · Lists & Tuples
#lists#indexing
10 questions · ~5 min
Not started
Start
2
List Methods
Easy
Know what append, extend, pop, remove and sort really do.
Python · Lists & Tuples
#lists#list-methods#sorting
10 questions · ~5 min
Not started
Start
3
Slicing Lists
Medium
Read and write list slices with start, stop, step and negative values.
Python · Lists & Tuples
#slicing#lists
10 questions · ~6 min
Not started
Start
4
Tuples & Unpacking
Medium
Work with tuples, swap values and unpack sequences into names.
Python · Lists & Tuples
#tuples#unpacking
10 questions · ~6 min
Not started
Start
5
Copying vs Referencing
Hard
Find out when two names share one list and when you really have a copy.
Python · Lists & Tuples
#mutability#gotchas#interview
10 questions · ~8 min
Not started
Start
1
Dictionary Basics
Easy
Create dictionaries, read and change values, and handle missing keys.
Python · Dictionaries & Sets
#dict#keys-values
10 questions · ~5 min
Not started
Start
2
Dictionary Methods
Medium
Use pop, setdefault, update, copy, views and the merge operator correctly.
Python · Dictionaries & Sets
#dict#dict-methods
10 questions · ~6 min
Not started
Start
3
Looping over Dicts
Medium
Loop over keys, values and items, and avoid the classic dict loop mistakes.
Python · Dictionaries & Sets
#dict#loops
10 questions · ~6 min
Not started
Start
4
Sets & Set Operations
Medium
Remove duplicates, test membership and combine sets with union, intersection and more.
Python · Dictionaries & Sets
#sets#set-operations
10 questions · ~6 min
Not started
Start
5
Nested Data Structures
Hard
Work with dicts inside lists inside dicts, copies, aliasing and JSON round trips.
Python · Dictionaries & Sets
#nesting#json#interview
10 questions · ~8 min
Not started
Start
1
Defining Functions & return
Easy
Define functions, call them, and know exactly what they return.
Python · Functions
#functions#return
10 questions · ~5 min
Not started
Start
2
Default & Keyword Arguments
Medium
Use default values and keyword arguments, and avoid the mutable default trap.
Python · Functions
#arguments#gotchas
10 questions · ~6 min
Not started
Start
3
*args and **kwargs
Medium
Collect extra arguments with *args and **kwargs and unpack lists and dicts into calls.
Python · Functions
#args-kwargs#unpacking
10 questions · ~6 min
Not started
Start
4
Scope & global
Hard
Local and global names, nonlocal, closures and the UnboundLocalError trap.
Python · Functions
#scope#closures#gotchas
10 questions · ~8 min
Not started
Start
5
Recursion
Hard
Trace recursive calls, find missing base cases and spot recursion bugs.
Python · Functions
#recursion#interview
10 questions · ~8 min
Not started
Start
1
enumerate, zip & sorted
Easy
Use the built-ins that replace index counters, parallel loops and hand-written sorting.
Python · Pythonic Python
#built-ins#loops#sorting
10 questions · ~5 min
Not started
Start
2
List Comprehensions
Medium
Predict what list, dict and generator comprehensions produce, including the classic traps.
Python · Pythonic Python
#comprehension#output-prediction
10 questions · ~6 min
Not started
Start
3
Lambda, map & filter
Medium
Write small anonymous functions and use them with map, filter, sorted and reduce.
Python · Pythonic Python
#lambda#map-filter#sorting
10 questions · ~6 min
Not started
Start
4
Generators & yield
Hard
Trace exactly when generator code runs, what it yields and when it is used up.
Python · Pythonic Python
#generators#iterators#output-prediction
10 questions · ~8 min
Not started
Start
5
Decorators
Hard
Read and write decorators, from simple wrappers to decorators that take arguments.
Python · Pythonic Python
#decorators#closures#interview
10 questions · ~8 min
Not started
Start
1
Classes & Objects
Easy
Learn how classes, objects, class attributes and instance attributes fit together.
Python · Object-Oriented Python
#oop#classes
10 questions · ~5 min
Not started
Start
2
__init__ & self
Easy
Set up new objects with __init__ and understand what self really is.
Python · Object-Oriented Python
#oop#constructors
10 questions · ~5 min
Not started
Start
3
Inheritance
Medium
Reuse and extend classes with inheritance, method overriding and super().
Python · Object-Oriented Python
#oop#inheritance
10 questions · ~6 min
Not started
Start
4
Dunder Methods
Hard
Make your classes work with print, ==, +, len, in, sorted and function calls.
Python · Object-Oriented Python
#oop#dunder-methods
10 questions · ~8 min
Not started
Start
5
Properties & Class Methods
Hard
Use @property, setters, @classmethod and @staticmethod, and avoid their traps.
Python · Object-Oriented Python
#oop#properties
10 questions · ~8 min
Not started
Start
1
Reading Tracebacks
Easy
Learn to read a Python traceback and find the line and the reason behind an error.
Python · Errors & Debugging
#tracebacks#debugging
10 questions · ~5 min
Not started
Start
2
Common Errors
Easy
Match everyday Python errors like TypeError, NameError and KeyError to the code that causes them.
Python · Errors & Debugging
#exceptions#debugging
10 questions · ~5 min
Not started
Start
3
try / except / finally
Medium
Predict how try, except, else and finally run together, including returns and loops.
Python · Errors & Debugging
#exceptions#control-flow
10 questions · ~6 min
Not started
Start
4
Raising Exceptions
Medium
Raise built-in and custom exceptions, re-raise them and chain them with from.
Python · Errors & Debugging
#exceptions#custom-exceptions
10 questions · ~6 min
Not started
Start
5
Find the Bug
Hard
Spot the classic Python gotchas behind code that runs but gives the wrong answer.
Python · Errors & Debugging
#debugging#gotchas#interview
10 questions · ~8 min
Not started
Start
1
Modules & Imports
Easy
Check how import, from ... import and aliases work in Python.
Python · Libraries & Files
#modules#imports
10 questions · ~5 min
Not started
Start
2
math & random
Easy
Rounding, powers and square roots with math, and what the random functions can return.
Python · Libraries & Files
#math#random#standard-library
10 questions · ~5 min
Not started
Start
3
File Reading & Writing
Medium
Open, write, append and read text files with the with statement and the right mode.
Python · Libraries & Files
#files#with-statement
10 questions · ~6 min
Not started
Start
4
datetime
Medium
Build, format, parse and do arithmetic with dates and times using the datetime module.
Python · Libraries & Files
#datetime#standard-library
10 questions · ~6 min
Not started
Start
5
collections
Hard
Use Counter, defaultdict, deque and namedtuple, and know their surprising behaviours.
Python · Libraries & Files
#collections#standard-library
10 questions · ~8 min
Not started
Start
1
Python Interview Questions for Freshers
Easy
The classic first-round Python questions on types, mutability, functions and lists.
Python · Python Interview Questions
#interview#basics
10 questions · ~5 min
Not started
Start
2
Output-Based Python Questions
Medium
Predict the exact output of short Python snippets, the way written interview rounds test you.
Python · Python Interview Questions
#output-prediction#interview
10 questions · ~6 min
Not started
Start
3
Tricky Python Questions
Hard
Real Python gotchas that catch even experienced developers in interviews.
Python · Python Interview Questions
#gotchas#interview
10 questions · ~8 min
Not started
Start
4
Python OOP Interview Questions
Medium
Classes, inheritance, super(), name mangling and abstract classes as interviewers ask about them.
Python · Python Interview Questions
#oop#interview
10 questions · ~6 min
Not started
Start
5
Python Coding Interview Questions
Hard
Time complexity, choosing the right data structure and classic coding-round patterns in Python.
Python · Python Interview Questions
#algorithms#complexity#interview
10 questions · ~8 min
Not started
Start
1
Type Hints
Medium
Write and read Python type hints, and know what they do and don't do at run time.
Python · Advanced Python
#typing#type-hints
10 questions · ~6 min
Not started
Start
2
Dataclasses & Enums
Medium
Use @dataclass to skip boilerplate and Enum to name fixed sets of values.
Python · Advanced Python
#dataclasses#enum
10 questions · ~6 min
Not started
Start
3
Context Managers & with
Medium
Understand what with really does, and write your own context managers.
Python · Advanced Python
#context-managers#with-statement
10 questions · ~6 min
Not started
Start
4
Regular Expressions (re)
Medium
Search, extract, split and replace text with Python's re module.
Python · Advanced Python
#regex#strings
10 questions · ~6 min
Not started
Start
5
asyncio Basics
Hard
Coroutines, await, gather and tasks, and how the asyncio event loop runs them.
Python · Advanced Python
#asyncio#async-await
10 questions · ~8 min
Not started
Start
No quiz matches. Try another word or tag.