1/9
Flashcards covering key concepts related to strings, including methods and properties.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is the first index in a string?
0
What is the last index in a string?
The size of the string minus one.
What happens if an index that is out of range for a string is accessed?
An IndexError exception will occur.
What function returns the length of a string?
len.
Which string method returns a copy of the string with all leading whitespace characters removed?
lstrip.
What string method returns the lowest index of a specified substring in the string?
find.
What operator determines if one string is contained within another?
in.
Which string method returns true if a string has only alphabetic characters?
isalpha.
Which string method returns true if a string has only numeric digits?
isdigit.
What string method returns a copy of the string with all leading and trailing whitespace removed?
strip.