Skip to content
L
LearnCoachAssist
Topics
AI
AI Agents (500 Questions)
AI Math (500 Questions)
AI Math Beginner
AI Search Results
Claude Code Prompts
Art & Design
Art History
Color Theory
Graphic Design Principles
Knitting And Crochet
Photography Exposure Triangle And Composition
Business
Accounting Basics
Customer Research
Economics
Excel Formulas For Financial Analysts
Go To Market Strategy
Browse all topics →
Packs
Featured Packs
Python Programming Essentials
Prompt Engineering
Prompting Claude Code
AI Agents and Autonomous Systems
SQL and Database Fundamentals
JavaScript Fundamentals
Algorithms and Data Structures
Git and Version Control
Browse all packs →
Learn
Learning Paths
AI Deck Generator
How it works
Quiz
Blog
Cheat Sheets
Pricing
Resources
Pricing
Compare
FAQ
About
Contact
Effective Studying Guide
Free Anki Decks
Log in
Start Free
Topics
AI
AI Agents (500 Questions)
AI Math (500 Questions)
AI Math Beginner
AI Search Results
Claude Code Prompts
Art & Design
Art History
Color Theory
Graphic Design Principles
Knitting And Crochet
Photography Exposure Triangle And Composition
Business
Accounting Basics
Customer Research
Economics
Excel Formulas For Financial Analysts
Go To Market Strategy
Browse all topics →
Packs
Python Programming Essentials
Prompt Engineering
Prompting Claude Code
AI Agents and Autonomous Systems
SQL and Database Fundamentals
JavaScript Fundamentals
Algorithms and Data Structures
Git and Version Control
Browse all packs →
Learn
Learning Paths
AI Deck Generator
How it works
Quiz
Blog
Cheat Sheets
Pricing
Resources
Pricing
Compare
FAQ
About
Contact
Effective Studying Guide
Free Anki Decks
Start Free
Log in
← Quit
Python Deep Dive Practice Exam
Question
1
of
50
60:00
Question 1
Python Deep Dive
What is a fixture (pytest)?
Reference counting + cyclic GC for circular references.
Declares a variable refers to module-level scope.
Reusable setup/teardown for tests.
Per-interpreter GIL (PEP 684) and sub-interpreters.
Question 2
Python Deep Dive
What is gunicorn?
A full-featured web framework with ORM, admin, and batteries.
Method run after dataclass __init__.
A WSGI HTTP server commonly used in production.
A function defined with async def that can be paused at await points.
Question 3
Python Deep Dive
What is Django?
A file listing package dependencies.
Writing tests before implementation.
A full-featured web framework with ORM, admin, and batteries.
Captures positional arguments as a tuple.
Question 4
Python Deep Dive
What is collections.ChainMap?
A class linking multiple dicts as a single mapping.
Python's library for asynchronous, single-threaded concurrency using coroutines.
A name for a type, e.g., UserID = int.
`not x` is true for any falsy value; `is None` checks specifically for None.
Question 5
Python Deep Dive
What is the GIL's effect on CPU-bound code?
Limits parallelism; use multiprocessing or native extensions.
Method run after dataclass __init__.
Checks if object is instance of a class (or subclass).
Creates a child process (Unix only); generally use multiprocessing.
Question 6
Python Deep Dive
What is __version__?
A source distribution format.
Context manager/decorator that replaces an object during a test.
Conventional module attribute for version info.
Measuring code performance to find bottlenecks.
Question 7
Python Deep Dive
What is "look before you leap" (LBYL)?
Use `is None` — it's faster and idiomatic.
List of directories Python searches for modules.
Checking conditions before acting; less Pythonic.
Applies a function cumulatively to a sequence.
Question 8
Python Deep Dive
What is __eq__?
Better tracebacks pointing to specific expressions.
Defines equality comparison.
Method Resolution Order — the order Python searches base classes (C3 linearization).
A function defined with async def that can be paused at await points.
Question 9
Python Deep Dive
What is coverage.py?
Delegates iteration to another iterable or generator.
Python's library for asynchronous, single-threaded concurrency using coroutines.
Boolean reductions: True if any/all elements are truthy.
A tool measuring code coverage of tests.
Question 10
Python Deep Dive
What is duck-typed protocol vs nominal typing?
Protocols check structure; nominal checks declared inheritance.
A source distribution format.
A lightweight, micro web framework.
Context manager/decorator that replaces an object during a test.
Question 11
Python Deep Dive
What is pickle?
Scope lookup order: Local, Enclosing, Global, Built-in.
Combines pip and virtualenv with a Pipfile.
Python-specific binary serialization.
Reading and writing CSV files.
Question 12
Python Deep Dive
What is if __name__ == "__main__":?
Exception raised when an iterator is exhausted.
Guards code so it only runs when the script is executed directly.
Reference counting + cyclic GC for circular references.
Asynchronous Server Gateway Interface — async successor to WSGI.
Question 13
Python Deep Dive
What is __all__?
* unpacks iterables, ** unpacks dicts.
A function that wraps another function, modifying its behavior.
A module attribute defining what names `from module import *` exports.
Memoization without size limit.
Question 14
Python Deep Dive
What is keyword-only parameter?
The runtime that schedules and runs coroutines in asyncio.
Parameters after * can only be passed by keyword.
Comprehensions are often more Pythonic and readable.
Lists are mutable; tuples are immutable and hashable.
Question 15
Python Deep Dive
What is type hinting?
Called when an attribute isn't found normally.
Reading and writing CSV files.
Optional annotations specifying expected types (PEP 484).
Parameters before / can only be passed positionally.
Question 16
Python Deep Dive
What is __main__.py?
A heap (priority queue) implementation.
Raises timeout error after specified seconds.
A decorator turning a generator into a context manager.
Entry point when a package is run with python -m pkg.
Question 17
Python Deep Dive
What is functools.partial?
Memoization without size limit.
Unit tests isolate; integration combines; e2e exercises the full system.
Called when setting an attribute.
Creates a function with some arguments pre-filled.
Question 18
Python Deep Dive
What is super()?
Like a list comprehension but lazy: (x*2 for x in range(10)).
Web Server Gateway Interface — synchronous Python web server standard.
Returns a proxy for calling the parent class's methods.
A tool for isolated Python environments (precursor to venv).
Question 19
Python Deep Dive
What is dataclass(frozen=True)?
Manages virtual environments for testing across versions.
Makes the instance immutable.
Modifying enclosing variables requires nonlocal.
zip stops at shortest; zip_longest pads with fillvalue.
Question 20
Python Deep Dive
What is __enter__ / __exit__?
A package and environment manager (popular in data science).
The reference implementation of Python, written in C.
Context manager protocol methods.
A static type checker for Python.
Question 21
Python Deep Dive
What is issubclass()?
A full-featured web framework with ORM, admin, and batteries.
Called when an attribute isn't found normally.
Checks if a class is a subclass of another.
An unordered collection of unique, hashable elements.
Question 22
Python Deep Dive
What is pathlib?
Object-oriented filesystem paths.
Refers to nearest enclosing (non-global) scope.
Binary search on sorted lists.
Reference counting + cyclic GC for circular references.
Question 23
Python Deep Dive
What is the role of asyncio.timeout()?
Raises timeout error after specified seconds.
Major.Minor.Patch scheme indicating compatibility.
Dict with fixed string keys and known value types (PEP 589).
Built-in SQLite database driver.
Question 24
Python Deep Dive
What is REPL?
Cryptographically secure random for secrets.
Declares a variable refers to module-level scope.
Read-Eval-Print Loop — Python's interactive prompt.
Throws an exception.
Question 25
Python Deep Dive
What is the fractions module?
It limits CPU-bound multithreading parallelism but allows simpler memory management.
Rational number arithmetic.
Keeps items where a function returns True.
A class can inherit from multiple parents.
Question 26
Python Deep Dive
What is the bytes type?
Immutable sequence of bytes.
Per-interpreter GIL (PEP 684) and sub-interpreters.
List of directories Python searches for modules.
Aggregate reductions over iterables.
Question 27
Python Deep Dive
What is the difference between import and from ... import?
A class attribute restricting which instance attributes can be set; saves memory.
import preserves namespace; from imports specific names.
Performs a shallow copy.
Boolean reductions: True if any/all elements are truthy.
Question 28
Python Deep Dive
What is truthy/falsy?
Context manager protocol methods.
A web app combining code, output, and narrative.
Class attributes are shared; instance attributes are per-instance.
Values evaluated in boolean contexts; empty containers, 0, None are falsy.
Question 29
Python Deep Dive
What is finally?
Runs whether or not an exception occurred.
An object supporting `with` via __enter__ and __exit__.
Context manager protocol methods.
Built-in profiler.
Question 30
Python Deep Dive
What is a decorator?
Use `is None` — it's faster and idiomatic.
Returns a value while suspending the function's state.
Python's built-in testing framework (xUnit style).
A function that wraps another function, modifying its behavior.
Question 31
Python Deep Dive
What is zip()?
Conventional module attribute for version info.
Combines multiple iterables element-wise.
Built-in SQLite database driver.
Block for handling exceptions.
Question 32
Python Deep Dive
What is raise?
Throws an exception.
Importing using . or .. from within a package.
Schedules a coroutine as a Task.
Returns a value while suspending the function's state.
Question 33
Python Deep Dive
What is the difference between pickle and JSON?
JSON is interoperable; pickle handles arbitrary Python objects but is Python-only and insecure with untrusted data.
`not x` is true for any falsy value; `is None` checks specifically for None.
Dynamically modifying code at runtime, often for tests.
Performs a deep copy.
Question 34
Python Deep Dive
What is the key parameter in sort?
Called for every attribute access; powerful but dangerous.
Codified via Protocol classes.
A function returning a sort key.
Applies a function to each item in an iterable.
Question 35
Python Deep Dive
What is socket module?
Low-level networking interface.
Optional annotations specifying expected types (PEP 484).
A package and environment manager (popular in data science).
Captures keyword arguments as a dict.
Question 36
Python Deep Dive
What is uvicorn?
Returns hash value; required for use in sets/dicts as keys.
An ASGI server for async frameworks.
Marks a name as final (can't be reassigned).
Third-party tool profiling line-by-line.
Question 37
Python Deep Dive
What is global keyword?
Base64 encoding and decoding.
Built-in SQLite database driver.
Python's official style guide.
Declares a variable refers to module-level scope.
Question 38
Python Deep Dive
What is a generator expression?
Pythonic style: try the operation, handle exceptions, rather than checking first.
Like a list comprehension but lazy: (x*2 for x in range(10)).
A tool for isolated Python environments (precursor to venv).
Measuring code performance to find bottlenecks.
Question 39
Python Deep Dive
What is a list comprehension?
A full-featured web framework with ORM, admin, and batteries.
A concise syntax for creating lists, e.g., [x*2 for x in range(10)].
A descriptor making a method accessible like an attribute.
A standard library module for context manager utilities.
Question 40
Python Deep Dive
What is tox?
Called for every attribute access; powerful but dangerous.
Formatted string literals (PEP 498): f"value={x}".
A faster Python implementation using JIT compilation.
Manages virtual environments for testing across versions.
Question 41
Python Deep Dive
What is csv module?
The match/case statement (PEP 634, Python 3.10+).
Reading and writing CSV files.
Shallow copies references; deep copy recursively duplicates objects.
Python's null value; the only instance of NoneType.
Question 42
Python Deep Dive
What is an event loop?
The runtime that schedules and runs coroutines in asyncio.
A name for a type, e.g., UserID = int.
Low-level networking interface.
A modern web framework using type hints, async, and OpenAPI.
Question 43
Python Deep Dive
What is StopIteration?
Manages virtual environments for testing across versions.
print() writes to stdout; logging is configurable with levels, handlers, formats.
match uses pattern matching syntax, not equality.
Exception raised when an iterator is exhausted.
Question 44
Python Deep Dive
What is __slots__?
A class parameterized by type variables.
A dict with default values for missing keys.
A class attribute restricting which instance attributes can be set; saves memory.
Major.Minor.Patch scheme indicating compatibility.
Question 45
Python Deep Dive
What is a logging formatter?
Specifies the layout of log records.
A documentation generator for Python.
Reusing a computed value via :=.
A web app combining code, output, and narrative.
Question 46
Python Deep Dive
What is the @ syntax for decorators?
Returns (quotient, remainder) of division.
Dict with fixed string keys and known value types (PEP 589).
Syntactic sugar: @decorator above def is equivalent to f = decorator(f).
Object-oriented filesystem paths.
Question 47
Python Deep Dive
What is PEP 657?
A dict maintaining insertion order (Python 3.7+ regular dicts also do).
Better tracebacks pointing to specific expressions.
* unpacks iterables, ** unpacks dicts.
Modifying enclosing variables requires nonlocal.
Question 48
Python Deep Dive
What is __set_name__?
Descriptor hook to learn the attribute name.
A class attribute restricting which instance attributes can be set; saves memory.
A function returning a sort key.
Reading TOML files in the standard library.
Question 49
Python Deep Dive
What is the difference between unit, integration, end-to-end tests?
Unit tests isolate; integration combines; e2e exercises the full system.
zip stops at shortest; zip_longest pads with fillvalue.
Mathematical functions and constants.
JSON is interoperable; pickle handles arbitrary Python objects but is Python-only and insecure with untrusted data.
Question 50
Python Deep Dive
What is FastAPI?
A class can inherit from multiple parents.
A modern web framework using type hints, async, and OpenAPI.
Makes the instance immutable.
Importing using . or .. from within a package.
Question navigator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
← Previous
Next →
✅ Submit Exam