Chapter 8 Key Terms Flashcards
Indexing
Is used to access individual elements of a sequence like strings, lists, or tuples.
IndexError Exception
An exception occurs when you try to access an index that is outside the valid range of indices for a sequence.
Concatenation
Combining two or more strings or sequences into a single string or sequence.
Immutable
The content in strings cannot be changed once created.
Slicing
Extract a portion of a sequence, such as a string or a list, by setting a start and end index.
in
Is used to check if a particular element exists in a sequence.
not in
Is used to check if a particular element does not exist in a sequence.
isalnum
A way to check if all characters in a string are alphanumeric.
isalpha
A way to check if all characters in a string are alphabetic.
isdigit
A way to check if all characters in a string are digits.
islower
A way to check if all characters in a string are in lowercase.
isspace
A way to check if all characters in a string are whitespace characters.
isupper
A way to check if all characters in a string are in uppercase.
lower
A way to convert all characters in a string to lowercase.
lstrip
A way to remove leading whitespace characters from a string. (Left)
lstrip(char)
A way to remove leading occurrences of a certain character from a string. (Left)
rstrip
A way to remove trailing whitespace characters from a string. (Right)
rstrip(char)
A way to remove trailing occurrences of a certain character from a string. (Right)
strip
A way to remove leading and trailing whitespace characters from a string.
strip(char)
A way to remove leading and trailing occurrences of a certain character from a string.
upper
A way to convert all characters in a string to uppercase.
endswith
A way to verify if a string ends with a specified substring.
find
A way to find the first occurrence of a substring in a string and return its index.
replace
A way to replace occurrences of a substring with another substring.
startswith
A way to verify if a string starts with a specified substring.
Repetition Operator *s
Is used to repeat a sequence a specified number of times.
split
A way to split a string into a list of substrings based on a certain delimiter.