Python Study Guide 2026

Everything you need to pass the Python exam in one place: the exam format, every topic to study, real practice questions with explanations, flashcards, and full-length practice tests. Free, no sign-up needed.

📋 Python Exam Format at a Glance

40
Questions
65 min
Time Limit
70%
Passing Score

📚 Python Topics to Study (21)

✍️ Sample Python Questions & Answers

1. Which of the following scenarios best demonstrates the concept of polymorphism in Python?
A function `render_shape(shape)` that can correctly draw a `shape` object whether it is a `Circle` or a `Square`, because both classes have a `.draw()` method.

Polymorphism (from Greek, meaning "many forms") is the ability of an object to take on many forms. In programming, it means that a single interface (like the `render_shape` function) can be used for objects of different types. The function can operate on different shape objects without needing to know their specific type, as long as they adhere to the common interface of having a `.draw()` method.

2. What does the following code output? print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))
False True True True

The `bool()` function converts a value to its boolean equivalent. In Python, zero (0), empty sequences/collections, and `None` are considered "falsy". All other numbers (including non-zero integers, floats, and complex numbers) are considered "truthy". Therefore, `bool(0)` is `False`, while `bool(3.14159)`, `bool(-3)`, and `bool(1.0+1j)` are all `True`.

3. What does the format string `'{0} {1}'.format('Hello', 'World')` produce?
'Hello World'

Positional placeholders {0} and {1} are replaced with the first and second format arguments.

4. What is a 'free variable' in the context of Python closures?
A variable used in a function but defined in an enclosing outer scope

A free variable is a variable referenced inside a function but not defined in that function's local scope — it is bound in an enclosing scope and captured by the closure.

5. What is the result of `[str(x) for x in range(3)]`?
['0', '1', '2']

str() converts each integer to its string representation, producing ['0', '1', '2'].

6. What is a closure in Python?
A function that captures and remembers variables from its enclosing scope

A closure is an inner function that remembers the values from its enclosing scope even when execution has moved outside that scope.

🎯 Free Python Practice Tests

📖 Python Guides & Articles

Your Python Study Path
1. Learn with Flashcards → 2. Drill Practice Tests → 3. Take the Full Exam Simulation