1/34
Vocabulary flashcards covering core Python fundamentals, basic data structures (lists, tuples, dictionaries, sets), operators, control flow statements, functions, strings, and file handling mechanisms based on lecture slides.
Variable
A named location in memory used to store data, created dynamically in Python when a value is assigned using the assignment operator =.
Dynamic Typing
A feature where the Python interpreter automatically determines the data type of a variable at runtime without requiring explicit type declaration.
input()
A built-in Python function that pauses execution to capture user-provided data from standard input, always returning the value as a string.
print()
A built-in Python function that outputs and displays information, such as text, variables, and evaluated expressions, to the standard output.
Data Types
Classifications that define the type of value stored in a variable, enabling the interpreter to allocate memory efficiently and restrict operations to compatible actions.
Operators
Special symbols (such as +, -, *, /, and %) used in Python to perform mathematical, relational, logical, or bitwise operations on values and variables.
Operands
The values or variables on which an operator performs an operation.
If Statement
A conditional control flow statement used to execute a specific block of code only when a designated condition evaluates to True.
If-Else Statement
A conditional statement that executes one block of code when a condition evaluates to True and another block when the condition evaluates to False.
Elif Statement
A conditional statement used to test multiple conditions sequentially, executing its block when its condition evaluates to True after previous conditions evaluated to False.
For Loop
A loop control structure used to iterate over a sequence (such as a list, tuple, string, or range), executing a code block once for each item in the sequence.
While Loop
A loop control structure that repeatedly executes a block of code as long as a specified condition remains True.
Python Function
A reusable block of code defined with the def keyword that performs a specific task and promotes code reusability, modularity, readability, and maintainability.
String
An indexed sequence of characters enclosed within single or double quotes, where individual characters are treated as strings of length one.
Multi-line String
A string that spans across multiple lines while preserving newline characters, created using triple quotes (''' or """).
String Slicing
A method used to extract a portion of a string using the syntax string[start:end], where the start index is included and the end stopping index is excluded.
List
A built-in Python data structure used to store an ordered, mutable, and index-based collection of items that is dynamic and can hold multiple data types.
append()
A list method that adds a single element to the very end of an existing list.
insert()
A list method that adds an element at a specific index position, shifting existing elements to the right.
extend()
A list method that adds multiple elements from an iterable sequence to the end of the list.
remove()
A list method that deletes the first occurrence of a specified element from the list.
pop()
A method that removes and returns the element at a specified index in a list (or the last item if no index is provided).
Nested List
A list that contains one or more other lists as elements, commonly used to represent tabular data or matrices and accessed via chained indices.
Tuple
A built-in Python collection data type that is ordered and immutable (unchangeable), typically written with round brackets ().
Dictionary
A data structure that stores information in key-value pairs, where keys must be unique and immutable, while values can be of any data type.
get()
A dictionary method used to safely access a value linked to a specific key, returning None or a default value instead of raising a KeyError if the key is missing.
popitem()
A dictionary method that removes and returns the last inserted key-value pair as a tuple.
Set
A built-in Python data type that stores an unordered collection of unique elements, automatically eliminating duplicate entries and using internal hashing for fast lookups.
Frozenset
An immutable, hashable version of a Python set created using frozenset() whose elements cannot be modified, allowing it to be used as a dictionary key.
union()
A set method that combines elements from two sets and returns a new set containing all distinct elements from both.
intersection()
A set method that returns a new set containing only the elements common to both sets.
difference()
A set method that returns a new set containing elements present in the first set but absent from the second set.
strip()
A string method commonly used during file reading to remove leading and trailing whitespace, including newline characters.
readline()
A file handling method that reads a single line from an open file at a time, allowing efficient processing of large files without loading the whole file into memory.
CSV (Comma-Separated Values)
A standard plain-text file format used for storing tabular data, supported in Python via the built-in csv module for parsing rows and columns.