Python String Methods Flashcards

1
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
2
Q

casefold()

A

Converts string into lower case

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

center()

A

Returns a centered string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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
5
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
6
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
7
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
8
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
9
Q

format()

A

Formats specified values in a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
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
11
Q

index()

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
12
Q

isalnum()

A

Returns True if all characters in the string are alphanumeric

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

isalpha()

A

Returns True if all characters in the string are in the alphabet

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

isascii()

A

Returns True if all characters in the string are ascii characters

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

isdecimal()

A

Returns True if all characters in the string are decimals

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

isdigit()

A

Returns True if all characters in the string are digits

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

isidentifier()

A

Returns True if the string is an identifier

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

islower()

A

Returns True if all characters in the string are lower case

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

isnumeric()

A

Returns True if all characters in the string are numeric

20
Q

isprintable()

A

Returns True if all characters in the string are printable

21
Q

isspace()

A

Returns True if all characters in the string are whitespaces

22
Q

istitle()

A

Returns True if the string follows the rules of a title

23
Q

isupper()

A

Returns True if all characters in the string are upper case

24
Q

join()

A

Converts the elements of an iterable into a string

25
Q

ljust()

A

Returns a left justified version of the string

26
Q

lower()

A

Converts a string into lower case

27
Q

lstrip()

A

Returns a left trim version of the string

28
Q

maketrans()

A

Returns a translation table to be used in translations

29
Q

partition()

A

Returns a tuple where the string is parted into three parts

30
Q

replace()

A

Returns a string where a specified value is replaced with a specified value

31
Q

rfind()

A

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

32
Q

rindex()

A

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

33
Q

rjust()

A

Returns a right justified version of the string

34
Q

rpartition()

A

Returns a tuple where the string is parted into three parts

35
Q

rsplit()

A

Splits the string at the specified separator, and returns a list

36
Q

rstrip()

A

Returns a right trim version of the string

37
Q

split()

A

Splits the string at the specified separator, and returns a list

38
Q

splitlines()

A

Splits the string at line breaks and returns a list

39
Q

startswith()

A

Returns true if the string starts with the specified value

40
Q

strip()

A

Returns a trimmed version of the string

41
Q

swapcase()

A

Swaps cases, lower case becomes upper case and vice versa

42
Q

title()

A

Converts the first character of each word to upper case

43
Q

translate()

A

Returns a translated string

44
Q

upper()

A

Converts a string into upper case

45
Q

zfill()

A

Fills the string with a specified number of 0 values at the beginning