string manipulation Flashcards

(9 cards)

1
Q

where does the variable and the string manipulation go?print(_______._____)

A

variable at the back and string manipulation at the front.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what string manipulations use this format

print(variable.str manip)

A

lower() ,upper() , title() , swapcase() , capitalize ,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what string manipulations use this format

print(variable.str manip(character or integer))

A

replace(“word”,”word”) , find(“letter”) , center(integer) , count(letter) ,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what string manipulations use this format print(str manip(variable))

A

len() and reversed()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what does the number do in the string manipulation

print(string[3])

A

it displays the third letter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does the ratio do in the string manipulation

print(string[3:6]

A

it displays from the third letter to the fifth letter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what does print(ord()) do

A

it converts the letter in the brackets into number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what does print(chr()) do

A

it converts the number in the brackets into a letter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how can letters be converted into numbers

A

every decimal(whole) number corresponds to a character in ASCII or UNICODE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly