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
📚 Python Topics to Study (69)
✍️ Sample Python Questions & Answers
1. What is the result of `divmod(17, 5)`?
`divmod(17, 5)` returns a tuple of `(quotient, remainder)`, which is `(3, 2)` since `17 = 5*3 + 2`.
2. Which of the following scenarios best demonstrates the concept of polymorphism in Python?
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.
3. What is the third argument to file.seek(offset, whence)?
The whence argument specifies the reference point: 0 for start of file, 1 for current position, and 2 for end of file.
4. Which method removes and returns the last element of a Python list?
`list.pop()` removes and returns the last element by default, or an element at a given index.
5. What does `enumerate()` return when iterating over a list?
`enumerate()` yields `(index, element)` tuples, letting you track both position and value in a loop.
6. What does the following code output? print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))
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`.