1/17
Vocabulary practice flashcards covering Python programming concepts, standard libraries (datetime, random, math), control structures, and syntax from Lab Questions 29 through 72.
Modulus Operator ()
An arithmetic operator that returns the remainder of division; used in programs to identify even numbers when n%2==0 and to extract the last digit via n%10.
Leap Year Condition
A conditional statement verifying whether a year is evenly divisible by 400, or divisible by 4 and not divisible by 100 (written as: year % 400 == 0 or (year % 4 == 0 and year % 100 != 0)).
range() Function
A built-in Python function generating a sequence of integers where the stop endpoint is excluded; for example, range(1, 11) yields values from 1 to 10, and a negative step like range(10, 0, -1) decrements values.
Fibonacci Series
A sequence of numbers starting with 0 and 1 in which each subsequent term is generated from the sum of the preceding two numbers using the update rule a, b = b, a + b.
for-else Loop Construct
A control flow structure in Python where the else block executes only if the for loop finishes all iterations without encountering a break statement.
Floor Division Operator (//)
An operator that performs integer division by discarding the fractional part; utilized in digit reversal algorithms as n//10 to eliminate the last digit.
datetime.datetime.now()
A method in the datetime module that retrieves and returns the current local date and time.
datetime.date.today()
A method in the datetime module that returns only the current local date containing year, month, and day attributes.
strftime()
A datetime method used to format date and time objects into specific string formats using directives such as %H:%M:%S for time or %d-%m-%Y for dates.
random.randint(a, b)
A function in Python's random module that returns a pseudorandom integer inclusive of both specified endpoints a and b.
random.choice()
A function in the random module that selects and returns a single random element from a non-empty sequence such as a list or a range.
math.sqrt()
A function from the math module that returns the square root of a given non-negative number.
math.pow(a, b)
A mathematical function that computes the base value a raised to the power b (ab).
math.ceil()
A function from the math module that returns the smallest integer that is greater than or equal to a given decimal value (e.g., 4.2 rounds up to 5).
math.floor()
A function from the math module that returns the largest integer that is less than or equal to a given decimal value (e.g., 4.8 rounds down to 4).
math.factorial()
A function from the math module that computes the factorial of a non-negative integer n, defined as the product of all integers from 1 to n, where the factorial of 0 is 1.
date.fromisoformat()
A class method of datetime.date that parses an ISO formatted date string structured as YYYY-MM-DD into a date object.
math.pi
A mathematical constant in the math module representing the ratio of a circle's circumference to its diameter (π), used to compute circle area (πr2) and circumference (2πr).