1/51
A comprehensive set of vocabulary flashcards covering Python variables, strings, lists, tuples, sets, and dictionaries to aid exam preparation.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Variable
A named container that stores a value in memory for later use.
Dynamic Typing
Python’s ability to infer a variable’s data type at assignment time without explicit declarations.
Integer Variable
A variable holding a whole-number value such as 5 or −3.
Float Variable
A variable storing a decimal number like 3.14.
String Variable
A variable whose value is text enclosed in quotes, e.g., "hello".
String Concatenation
Joining two or more strings together using the + operator.
String Indexing
Accessing individual characters in a string by position using square brackets.
Zero-Based Indexing
Counting string (or list) positions starting at 0 for the first element.
Negative Index
An index that starts from −1 for the last element and moves leftward.
String Slicing
Extracting a substring with syntax [start:stop].
Slice Omission
Leaving out start or stop in a slice to imply the beginning or end of the sequence.
String Immutability
Property that prevents changing individual characters of an existing string.
len() Function
Built-in that returns the number of items in a string, list, or other container.
List
An ordered, mutable collection defined with square brackets [].
Heterogeneous List
A list containing elements of different data types.
Nested List
A list that contains one or more lists as its elements.
List Indexing
Retrieving a single list element by its numeric position.
List Negative Indexing
Using −1, −2, etc., to access elements from the list’s end.
List Slicing
Getting a sublist with the [start:stop] notation.
List Mutability
Characteristic allowing list contents to be changed after creation.
append()
List method that adds a single element to the end.
insert()
List method that adds an element at a specified index.
remove()
List method that deletes the first occurrence of a specified value.
pop()
List method that removes and returns an element by index (last if none given).
del Statement
Keyword that can delete list elements or slices by index range.
clear()
List method that empties all elements from the list.
extend()
List method that adds each element from an iterable to the list.
min()
Built-in that returns the smallest element in a list.
max()
Built-in that returns the largest element in a list.
sum()
Built-in that totals numeric elements in a list.
sort()
List method that orders elements in ascending order in place.
Tuple
An ordered, immutable sequence defined with round brackets ().
Tuple Immutability
Quality that prevents any change to a tuple’s contents after creation.
Tuple Methods
Limited operations count() and index() that do not modify the tuple.
Tuple Performance Benefit
Faster iteration versus lists due to immutability optimizations.
Set
An unordered collection of unique elements defined with curly braces {}.
Unordered Set
Set characteristic that does not preserve insertion order.
Unique Elements
Rule that prohibits duplicate values within a set.
Hashing
Internal mechanism allowing sets fast membership tests and lookups.
add() (set)
Method that inserts a new element into a set.
remove() (set)
Method that deletes a specified element from a set; raises error if absent.
pop() (set)
Method that removes and returns an arbitrary element from a set.
Set Membership Test
Using the in keyword to check if a value exists in a set.
No Indexing in Set
Sets lack positional access because they are unordered.
Dictionary
A mutable collection of key-value pairs defined with curly braces {key: value}.
Key-Value Pair
The fundamental element of a dictionary linking a unique key to its value.
Immutable Key
Requirement that dictionary keys be unchangeable types such as strings or numbers.
.get() Method
Dictionary method that safely retrieves a value and returns a default if the key is missing.
zip() to dict
Technique that pairs two lists and converts them into a dictionary using dict(zip()).
Adding Dictionary Entry
Assigning a value to a new key using dict[key] = value.
del Keyword (dictionary)
Command that deletes a key-value pair from a dictionary.
Nested Dictionary
A dictionary that stores another dictionary (or list) as a value for hierarchical data.