🌍 Python Programming · flashcards
Python Programming Advanced Topics and Applied Libraries Flashcards
55 question-and-answer cards covering Advanced Topics and Applied Libraries as it is examined in Python Programming. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Advanced Topics and Applied Libraries deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
In unittest, what are the roles of setUp() and tearDown()?
setUp() runs before each test method to prepare fixtures; tearDown() runs after each test method to clean up.
Name three common unittest assertion methods and what they check.
assertEqual(a, b) checks a == b; assertTrue(x) checks x is truthy; assertRaises(Exc) checks that the given exception is raised.
How does pytest discover and identify test functions, and how do you assert conditions?
pytest auto-discovers files named test_*.py or *_test.py and functions prefixed with test_; you use plain Python assert statements for checks.
What is a pytest fixture and how is one defined and used?
A fixture supplies reusable setup/teardown or test data; you define it with the @pytest.fixture decorator and use it by naming it as a test function's parameter.
Which pytest decorator runs the same test with multiple sets of input values?
@pytest.mark.parametrize, which supplies argument names and a list of value sets to run the test multiple times.
Which standard-library module is Python's interactive source-code debugger, and what one-line call sets a breakpoint?
pdb; calling pdb.set_trace() (or the built-in breakpoint() in Python 3.7+) sets a breakpoint at that line.
In pdb, what do the commands n (next), s (step), and c (continue) do?
n executes the current line without entering functions, s steps into a called function, and c resumes execution until the next breakpoint or program end.
Which standard-library module provides configurable logging, and what function gives you a logger instance?
The logging module; logging.getLogger(name) returns a logger instance.
List Python logging's five standard severity levels from lowest to highest.
DEBUG, INFO, WARNING, ERROR, CRITICAL (increasing severity).
What is the default logging level in Python, meaning which messages appear if you don't configure logging?
WARNING is the default level, so only WARNING, ERROR, and CRITICAL messages are shown by default.
Which module provides low-level networking, and what two arguments to socket.socket() specify TCP versus UDP over IPv4?
The socket module; socket.socket(socket.AF_INET, socket.SOCK_STREAM) is TCP, and socket.SOCK_DGRAM is UDP.
List the typical sequence of socket calls for a TCP server.
socket() → bind((host, port)) → listen() → accept() (to get a connection) → recv()/send() → close().
Which popular third-party library simplifies making HTTP requests in Python, and how do you send a GET request?
The requests library; requests.get(url) sends a GET request and returns a Response object.
For a requests Response object, what do .status_code, .text, and .json() give you?
.status_code is the HTTP status code, .text is the response body as a string, and .json() parses a JSON body into a Python object.
Compare Django and Flask as Python web frameworks.
Django is a full-stack, 'batteries-included' framework with a built-in ORM, admin, and auth; Flask is a lightweight micro-framework that is minimal and extended via add-ons. (FastAPI is a modern async framework with automatic validation.)
What does REST stand for, and which HTTP methods map to the typical CRUD operations?
Representational State Transfer; GET = read, POST = create, PUT/PATCH = update, and DELETE = delete.
In REST APIs, what do HTTP status codes 200, 201, 404, and 500 indicate?
200 OK (success), 201 Created (resource created), 404 Not Found, and 500 Internal Server Error.
What is NumPy's core data structure, and what advantages does it offer over a Python list for numerical work?
The ndarray (N-dimensional array); it stores homogeneous data in contiguous memory, enabling fast vectorized operations and using less memory than lists.
In NumPy, what do the array attributes .shape, .dtype, and .ndim tell you?
.shape gives the size along each dimension (as a tuple), .dtype gives the element data type, and .ndim gives the number of dimensions.
What is NumPy broadcasting?
A set of rules that lets NumPy perform element-wise operations on arrays of different shapes by virtually stretching the smaller array's dimensions to match, without copying data.
In Pandas, what is the difference between a Series and a DataFrame?
A Series is a one-dimensional labeled array; a DataFrame is a two-dimensional labeled table with rows and columns (a collection of Series sharing an index).
In Pandas, what is the difference between .loc and .iloc for selecting data?
.loc selects by label (row/column names), while .iloc selects by integer position.
Which Pandas function reads a CSV file into a DataFrame, and which method writes a DataFrame back to CSV?
pd.read_csv() reads a CSV into a DataFrame, and DataFrame.to_csv() writes it back out.
In Pandas, what does the groupby() operation do, following the split-apply-combine pattern?
It splits the data into groups based on key values, applies an aggregation or function to each group, and combines the results into a new object.
What this deck covers
The Advanced Topics and Applied Libraries deck follows the Python Programming Advanced Topics and Applied Libraries syllabus — 6 chapters and 24 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 9.2 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 122 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Advanced Topics and Applied Libraries flashcards FAQ
How many Advanced Topics and Applied Libraries flashcards are in this Python Programming deck?
55 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these Python Programming flashcards free?
Yes. The preview here is free to read with no signup, and the full 55-card deck is free inside the Examius app.
What do the Advanced Topics and Applied Libraries cards cover?
They follow the Python Programming Advanced Topics and Applied Libraries syllabus — 6 chapters and 24 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.