Python Strings Flashcards
True or False: strings are arrays
True
Can you loop through characters in a string?
Yes
What functions do I use to get the length of a string?
len()
What keyword can I use to check if a certain phrase or character is in a string?
‘in’
What is the opposite of the ‘in’ phrase?
‘not in’
What function returns the upper-case version of a string?
upper()
What functions returns the lower-case version of a string?
lower()
What function removes any whitespace from the beginning or end of a string?
strip()
What function replaces a string with another string?
replace()
What function returns a list where the text between the specified separator becomes the list items?
split()
What operator is used to concatenate strings?
’+’ operator
What function allows you to combine numbers and strings?
format()
What is the escape character?
’/’