Strings Flashcards
Converts the first character to upper case
capitalize()
Converts string into lower case
casefold()
Returns a centered string
center()
Returns the number of times a specified value occurs in a string
count()
Returns an encoded version of the string
encode()
Returns true if the string ends with the specified value
endswith()
Sets the tab size of the string
expandtabs()
Searches the string for a specified value and returns the position of where it was found
find()
Formats specified values in a string
format()
Formats specified values in a string
format_map()
Searches the string for a specified value and returns the position of where it was found
index()
Returns True if all characters in the string are alphanumeric
isalnum()
Returns True if all characters in the string are in the alphabet
isalpha()
Returns True if all characters in the string are decimals
isdecimal()
Returns True if all characters in the string are digits
isdigit()
Returns True if the string is an identifier
Returns True if the string is an identifier
Returns True if all characters in the string are lower case
islower()
Returns True if all characters in the string are numeric
isnumeric()
Returns True if all characters in the string are printable
isprintable()
Returns True if all characters in the string are whitespaces
isspace()
Returns True if the string follows the rules of a title
istitle()
Returns True if all characters in the string are upper case
isupper()
Joins the elements of an iterable to the end of the string
join()
Returns a left justified version of the string
ljust()
Converts a string into lower case
lower()
Returns a left trim version of the string
lstrip()
Returns a translation table to be used in translations
maketrans()
Returns a tuple where the string is parted into three parts
partition()
Returns a string where a specified value is replaced with a specified value
replace()
Searches the string for a specified value and returns the last position of where it was found
rfind()
Searches the string for a specified value and returns the last position of where it was found
rindex()
Returns a right justified version of the string
rjust()
Returns a tuple where the string is parted into three parts
rpartition()
Splits the string at the specified separator, and returns a list
rsplit()
Splits the string at the specified separator, and returns a list
split()
Splits the string at line breaks and returns a list
splitlines()
Returns true if the string starts with the specified value
startswith()
Returns a trimmed version of the string
strip()
Swaps cases, lower case becomes upper case and vice versa
swapcase()
Converts the first character of each word to upper case
title()
Returns a translated string
translate()
Converts a string into upper case
upper()
Fills the string with a specified number of 0 values at the beginning
zfill()