string methods (brief) Flashcards

1
Q

Special point about string methods

A

All string methods returns new values. They do not change the original string.

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

capitalize()

A

Converts the first character to upper case

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

casefold()

A

Converts string into lower case

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

center()

A

Returns a centered string

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

count()

A

Returns the number of times a specified value occurs in a string

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

encode()

A

Returns an encoded version of the string

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

endswith()

A

Returns true if the string ends with the specified value

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

expandtabs()

A

Sets the tab size of the string

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

find()

A

Searches the string for a specified value and returns the position of where it was found

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

format()

A

Formats specified values in a string

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

format_map()

A

Formats specified values in a string

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