1/59
A comprehensive set of vocabulary flashcards covering basic Python string, list, tuple, and dictionary manipulations, built-in methods, and standard library modules like math, random, and statistics.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
String
In Python, a sequence of characters enclosed in quotes that can hold any type of known characters.
Immutable
A characteristic of strings and tuples meaning once they are created, the items or characters within them cannot be changed.
Forward Indexing
A memory location indexing method where the index starts from zero (0) and moves from left to right.
Backward Indexing
A memory location indexing method where the index starts from minus one (−1) and moves from right to left.
Concatenation (+)
The operation of joining two or more strings or lists into one.
Replication (∗)
An operator that creates multiple copies of a string or repeats the elements of a list a specific number of times.
Membership Operators (in and not in)
Operators that check if a specific character, substring, or value exists within a sequence, returning a Boolean value (True or False).
String Slicing
The process of extracting a substring or sub-list using the syntax [start : stop : step], where start is included and stop is excluded.
ord() Function
A function that takes a single string character and returns its corresponding Unicode number.
chr() Function
A function that takes an integer representing a Unicode value and returns its corresponding character.
len() Function
A built-in function that returns the total count of elements or characters in a string, list, tuple, dictionary, or set.
Traversing
The process of visiting every character or item in a sequence one by one from the beginning to the end.
capitalize() Method
A string method that converts the very first character to uppercase and all other characters to lowercase.
title() Method
A string method that capitalizes the first letter of every word and converts remaining letters to lowercase, using spaces, hyphens, or quotes as separators.
count() Method
Used to find how many times a specific (case-sensitive) substring or element appears within a larger string or list.
find() Method
A string method that returns the index of the first occurrence of a substring, or −1 if the substring is not found.
index() Method
A method used with strings or lists to find the index of the first occurrence of a value; it raises a ValueError if the item is not found.
isalpha() Method
Returns True if a string consists entirely of alphabetic characters (letters).
islower() Method
Checks whether all alphabetic characters in a string are lowercase.
isdecimal() Method
Returns True only for string characters that can be used to form numbers in base 10 (0 through 9).
isdigit() Method
Returns True for all characters in a string that are digits, including superscripts and subscripts.
isnumeric() Method
Returns True for any numeric representation in a string, including fractions and Roman numerals.
isspace() Method
Checks if a string consists only of whitespace characters such as standard spaces, '\t', '\n', '\v', '\r', or '\f'.
strip() Method
A method used to remove leading and trailing whitespace or specific characters from a string.
replace() Method
A string method that creates a new string by replacing all or a specific count of occurrences of a substring with another.
join() Method
Returns a new string by joining elements of an iterable (like a list or tuple) using a specified string separator.
partition() Method
Splits a string into exactly three parts based on the first occurrence of a separator and returns them as a tuple.
split() Method
Breaks a string into a list of substrings based on a specified delimiter; if no delimiter is specified, it splits by any whitespace.
List
A mutable, ordered sequence data type that allows duplicate items and can contain heterogeneous data types.
enumerate() Function
Returns the index and items from an iterable as a tuple, starting from zero (0) or a specified start parameter.
Shallow Copy
A copy created using the copy() method or list() constructor where top-level items are independent, but nested lists remain shared between original and copy.
eval() Function
Evaluates and returns the result of a mathematical expression or data structure given as a string.
append() Method
Adds a single item to the very end of an existing list and modifies it in-place.
extend() Method
Adds multiple elements from an iterable individually to the end of a list.
insert() Method
Adds an element to a list at a specific index by shifting existing items one position to the right.
pop() Method
Removes and returns an item from a list based on an index; defaults to the last item if no index is provided.
del Statement
A Python keyword used to remove items by index/slice or delete an entire variable from memory; it does not return a value.
clear() Method
Removes all items from a list or dictionary, leaving it completely empty.
sort() Method
Arranges list elements in ascending or descending order in-place and returns None.
sorted() Function
Takes any iterable and returns a brand-new list containing the elements in sorted order.
sum() Function
Calculates the total of all elements in a numerical list or tuple.
Nested List
A list that contains other lists as its individual elements.
Tuple
An ordered, immutable collection data type that is indexed and allows duplicate values.
Tuple Unpacking
A process that extracts values from a tuple and assigns them to multiple variables in a single line of code.
Dictionary
A mutable, ordered collection of unique key-value pairs where keys must be of an immutable data type.
.get() Method
Accesses a dictionary value by key without crashing; returns None or a specified default value if the key is missing.
.update() Method
A dictionary method used to change or add multiple items at once using another dictionary or iterable of pairs.
.items() Method
A dictionary method that returns a view of key-value pairs as tuples.
fromkeys() Method
Creates a new dictionary from an iterable of keys, assigning each key a specified value or None by default.
setdefault() Method
Returns the value of a key if it exists; if not, it inserts the key with a specified default value and returns that value.
popitem() Method
Removes and returns the last key-value pair from a dictionary as a tuple.
Python Module
A file containing Python code (functions, classes, or variables) that can be imported to improve maintainability and reusability.
math.ceil(x)
A math module function that always rounds a number up to the nearest whole integer.
math.floor(x)
A math module function that always rounds a number down to the nearest whole integer.
math.fabs(x)
Returns the absolute value of a number as a float, stripping away any negative sign.
random.randint(a,b)
Returns a random integer between a and b, inclusive of both endpoints.
random.randrange(start,stop,step)
Picks one random integer within a range where the stop value is exclusive.
statistics.mean()
Calculates the average of a collection of numerical data by dividing the sum of all numbers by the count.
statistics.median()
Identifies the middle value in a sorted dataset; it averages the two center values if the count is even.
statistics.mode()
Returns the value that appears most frequently in a dataset.