string manipulation Flashcards
(9 cards)
where does the variable and the string manipulation go?print(_______._____)
variable at the back and string manipulation at the front.
what string manipulations use this format
print(variable.str manip)
lower() ,upper() , title() , swapcase() , capitalize ,
what string manipulations use this format
print(variable.str manip(character or integer))
replace(“word”,”word”) , find(“letter”) , center(integer) , count(letter) ,
what string manipulations use this format print(str manip(variable))
len() and reversed()
what does the number do in the string manipulation
print(string[3])
it displays the third letter
what does the ratio do in the string manipulation
print(string[3:6]
it displays from the third letter to the fifth letter
what does print(ord()) do
it converts the letter in the brackets into number
what does print(chr()) do
it converts the number in the brackets into a letter
how can letters be converted into numbers
every decimal(whole) number corresponds to a character in ASCII or UNICODE