1/31
Vocabulary flashcards covering core Python fundamentals, including variable rules, data types, operators, conditionals, loops, range mechanics, and list operations.
int
A Python primary data type representing whole numbers (positive or negative) without decimal points, such as 10, −5, and 0.
float
A Python primary data type representing numbers containing one or more decimal places, such as 26.7, 3.14, and 1.0.
str
A Python primary data type representing text enclosed in single ('…') or double ("…") quotation marks, such as "Hello" or 'Python'.
bool
A Python primary data type representing truth values denoted by True or False.
Variable Naming Rules
Syntax rules in Python requiring variable names to contain letters, digits, and underscores (_), start with a letter or underscore, not start with a number, avoid special characters (such as ~ or @) and spaces, avoid reserved keywords, and remain case-sensitive.
print()
A built-in function that displays values on the screen and automatically creates a new line afterwards.
input()
A built-in function that pauses program execution and always returns user input as a string (str).
TypeError
An error caused by attempting to add an integer directly to a string returned by input() without converting the type.
Standard Division (/)
A basic arithmetic operator that divides numbers and always produces a float output.
Floor Division (//)
An arithmetic operator that truncates decimals and returns a whole integer.
Modulo (%)
An arithmetic operator that returns the remainder of a division operation.
Exponentiation (**)
An arithmetic operator that raises a base number to a power.
Equal To (==)
A comparison operator that evaluates whether two values are equal, unlike the single equals sign (=) which performs variable assignment.
or
A logical operator that evaluates to True if at least one condition is True.
and
A logical operator that evaluates to True only if both conditions evaluate to True.
not
A logical operator that inverts a boolean value, changing True to False and vice versa.
if Statement
A conditional statement that tests a condition and executes its indented block only if that condition evaluates to True.
elif Statement
Short for else if, a statement that tests subsequent conditions sequentially whenever previous conditions evaluate to False.
else Statement
A conditional statement that acts as the fallback block when none of the preceding conditions in the statement chain are met.
while Loop
A condition-controlled loop that repeatedly executes its code block as long as its specified condition remains True.
Loop Control Variable
A variable updated inside a while loop body (such as x=x+3 or count=count+1) to prevent an infinite loop error.
break Statement
A control statement that immediately terminates and exits a loop regardless of the loop condition.
for Loop
A loop that iterates over a sequence a predetermined number of times or through items in a collection.
range(stop)
A sequence generation function that produces integers from 0 up to stop−1.
range(start, stop)
A sequence generation function that produces integers starting from start up to stop−1.
range(start, stop, step)
A sequence generation function that generates numbers from start up to stop−1, incrementing by the step value on each iteration.
String Repetition
An operation where multiplying a string by an integer duplicates the string a specified number of times (such as "*" * 3 yielding "***").
Python List
An ordered, mutable collection of items enclosed in square brackets [].
Zero-Based Indexing
An indexing convention used by lists where the first element is located at index 0, the second at index 1, and so forth.
IndexError
An error triggered when attempting to access a list index that is equal to or greater than the total length of the list.
len()
A built-in function that returns the total count of items in a list or characters in a string.
String Concatenation (+)
An operation using the plus (+) operator that joins multiple strings together end-to-end without adding automatic spaces.