string module functions Flashcards

1
Q

replace()

A

replace(): method replaces a specified phrase with another specified phrase

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

find()

A

find(): finds the first occurrence of the specified value

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

lower()

A

lower(): Lowercases the alphabetical values in a string

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

upper()

A

upper(): Uppercases the alphabetical values in a string

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

strip()

A

strip(): removes any leading, and trailing whitespaces

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

capitalize()

A

capitalize(): Returns a copy of the string with its first character capitalized.

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

title()

A

title(): Returns a titlecased version of the string, where words start with an uppercase character and the remaining characters are lowercase.

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

center(width[, fillchar])

A

center(width[, fillchar]): Returns a centered string of a specified width, optionally padded with a fill character.

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

count(sub[, start[, end]])

A

count(sub[, start[, end]]): Returns the number of occurrences of a substring in the given range.

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

endswith(suffix[, start[, end]])

A

endswith(suffix[, start[, end]]): Returns True if the string ends with the specified suffix; otherwise, returns False.

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

join(iterable)

A

join(iterable): links elements of an iterable (e.g., a list) into a single string, with the string as a separator.

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

split([sep[, maxsplit]])

A

split([sep[, maxsplit]]): Splits a string into a list of substrings based on a specified separator.

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

strip([chars])

A

strip([chars]): Returns a copy of the string with leading and trailing characters removed (whitespace by default, or characters specified in chars).

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

replace(old, new[, count])

A

replace(old, new[, count]): Replaces occurrences of a specified substring with another substring.

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

startswith(prefix[, start[, end]])

A

startswith(prefix[, start[, end]]): Returns True if the string starts with the specified prefix; otherwise, returns False.

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