1/29
30 vocabulary flashcards covering Python functions, operators, control structures, and concepts demonstrated in the lecture’s sample code.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
float()
Python built-in function that converts a value to a floating-point number.
int()
Python built-in function that converts a value to an integer.
input()
Function that pauses program execution to accept user text from the console and returns it as a string.
Addition Operator (+)
Arithmetic operator that computes the sum of two numbers.
Subtraction Operator (−)
Arithmetic operator that computes the difference between two numbers.
Multiplication Operator (*)
Arithmetic operator that computes the product of two numbers.
Division Operator (/)
Arithmetic operator that computes the quotient of two numbers as a float.
Modulus Operator (%)
Arithmetic operator that returns the remainder of a division operation, commonly used to test even or odd numbers.
Comparison Operator (!=)
Operator that evaluates to True when two operands are not equal.
Comparison Operator (>)
Operator that evaluates to True when the left operand is strictly greater than the right operand.
Comparison Operator (>=)
Operator that evaluates to True when the left operand is greater than or equal to the right operand.
if Statement
Control structure that executes a block of code only when its condition evaluates to True.
else Clause
Part of an if statement that executes when the if condition evaluates to False.
f-string
Formatted string literal prefixed with f that allows inline expression evaluation using curly braces.
Function Definition (def)
Python keyword used to declare a reusable block of code that can accept parameters and return a value.
Return Statement
Statement inside a function that immediately ends execution and sends a value back to the caller.
Parameter
Variable listed in a function’s definition that receives a value when the function is called.
Argument
Actual value passed to a function parameter during a call.
Variable
Named storage location used to hold data that can be changed during program execution.
Type Casting
Explicit conversion of one data type to another, such as converting a string from input() to int or float.
Zero Division Guard
Programming pattern that checks if a divisor is zero before performing division to avoid runtime errors.
Even Number
Integer divisible by 2 with no remainder (number % 2 == 0).
Odd Number
Integer that leaves a remainder of 1 when divided by 2 (number % 2 != 0).
Product
Result obtained from multiplying two numbers (num1 * num2).
Sum
Result obtained from adding two numbers (num1 + num2).
Attendance Percentage
Ratio of attended classes to total classes multiplied by 100 to measure class participation.
Eligibility Check
Conditional test that determines if a student can sit for an exam based on attendance percentage ≥ 75.
Condition
Boolean expression evaluated within control structures like if and else.
User Prompt
Text displayed inside input() to inform users what data to enter.
Console Output
Information displayed to the user via print() statements during program execution.