Advanced Python Concepts

Evaluate your knowledge of decorators,generators,and context managers.

1. What is the primary purpose of a Python decorator?
2. Which keyword is used to create a generator function in Python?
3. Which module is used to define type hints in Python 3.5+?
4. Which methods must a class implement to act as a context manager with the 'with' statement?
5. What is a metaclass in Python?
6. Which of the following are functional programming constructs in Python?
7. Which exceptions are subclasses of OSError?
8. Which statements about generators are true?
9. What are consequences of the Global Interpreter Lock (GIL) in CPython?
10. A Python decorator can modify the return value of a decorated function.
11. Python supports multiple inheritance (a class inheriting from multiple parent classes).
12. Asyncio is primarily used for CPU-bound tasks in Python.
13. What term describes a function that returns an iterator and uses the 'yield' keyword?
14. What does the acronym 'GIL' stand for in Python?
15. Name the built-in function that returns tuples of (index, value) for an iterable.
Answered 0 of 0 — 0 correct