🌍 Python Programming · flashcards
Python Programming Python Fundamentals And Program Structure Flashcards
50 question-and-answer cards covering Python Fundamentals And Program Structure 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 Python Fundamentals And Program Structure deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
What is the special value used to represent 'no value' in Python?
None (of type NoneType).
What does the // operator do in Python?
Floor division: it divides and returns the largest integer less than or equal to the result (e.g., 7 // 2 = 3).
What does the ** operator do?
Exponentiation (power), e.g., 2 ** 3 = 8.
What does the modulus operator % return?
The remainder of a division, e.g., 7 % 3 = 1.
List the three logical operators in Python.
and, or, and not.
What is the difference between == and = in Python?
== is the equality comparison operator; = is the assignment operator.
What do the membership operators 'in' and 'not in' check?
Whether a value is present (or absent) in a sequence such as a list, string, or tuple.
What do the identity operators 'is' and 'is not' check?
Whether two variables refer to the same object in memory (same identity), not just equal values.
What is type conversion in Python?
Changing the data type of a value from one type to another.
What is the difference between implicit and explicit type conversion?
Implicit conversion is done automatically by Python (e.g., int to float in mixed arithmetic); explicit conversion (casting) is done manually with functions like int(), float(), str().
Which function converts a value to a floating-point number?
float().
What does str(123) return?
The string '123'.
What is the general syntax of an if-elif-else statement in Python?
if condition: ... elif other_condition: ... else: ... — each block is indented, and conditions are tested in order.
What is a nested conditional statement?
An if/else statement placed inside another if or else block.
What is the ternary (conditional) expression syntax in Python?
value_if_true if condition else value_if_false.
What are the two main looping constructs in Python?
The for loop and the while loop.
When is a for loop typically used versus a while loop?
A for loop iterates over a known sequence/range; a while loop repeats as long as a condition remains true (often for unknown iteration counts).
What does range(1, 10, 2) generate?
The numbers 1, 3, 5, 7, 9 (start 1, stop before 10, step 2).
What does the break statement do in a loop?
It immediately terminates the nearest enclosing loop and transfers control to the statement after it.
What does the continue statement do?
It skips the rest of the current iteration and moves to the next iteration of the loop.
What is the purpose of the pass statement?
It is a null/placeholder statement that does nothing, used where a statement is syntactically required but no action is needed.
What does the else clause of a loop do in Python?
The loop's else block runs after the loop finishes normally (i.e., when it was not terminated by a break).
Write a loop pattern to print a right-angled triangle of stars with n rows.
for i in range(1, n+1): print('*' * i) — prints 1 star on row 1, up to n stars on row n.
How would you check whether a number n is prime using a loop?
Loop from 2 to sqrt(n) (or n-1); if any i divides n evenly (n % i == 0), it is not prime; otherwise it is prime (n must also be greater than 1).
What this deck covers
This deck covers the Python Fundamentals And Program Structure portion of the Python Programming syllabus in question-and-answer form. Browse the full Python Programming syllabus to see how it fits with the rest.
Answers are written to be recallable, not just readable — averaging about 78 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.
Python Fundamentals And Program Structure flashcards FAQ
How many Python Fundamentals And Program Structure flashcards are in this Python Programming deck?
50 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 50-card deck is free inside the Examius app.
What do the Python Fundamentals And Program Structure cards cover?
They follow the Python Fundamentals And Program Structure portion of the Python Programming syllabus, in question-and-answer form.
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.