2.2 string manipulation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what to use to slice strings?

A

parts of a string can be extracted by giving the index location in the formation:
[start position:end position]

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

variable.upper()

A

this means that the variable will be made in to all caps

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

variable.replace(“a”,”x”)

A

this will replace all a’s in the variable with x’s

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