Python String Methods Flashcards

(45 cards)

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
ljust()
Returns a left justified version of the string
26
lower()
Converts a string into lower case
27
lstrip()
Returns a left trim version of the string
28
maketrans()
Returns a translation table to be used in translations
29
partition()
Returns a tuple where the string is parted into three parts
30
replace()
Returns a string where a specified value is replaced with a specified value
31
rfind()
Searches the string for a specified value and returns the last position of where it was found
32
rindex()
Searches the string for a specified value and returns the last position of where it was found
33
rjust()
Returns a right justified version of the string
34
rpartition()
Returns a tuple where the string is parted into three parts
35
rsplit()
Splits the string at the specified separator, and returns a list
36
rstrip()
Returns a right trim version of the string
37
split()
Splits the string at the specified separator, and returns a list
38
splitlines()
Splits the string at line breaks and returns a list
39
startswith()
Returns true if the string starts with the specified value
40
strip()
Returns a trimmed version of the string
41
swapcase()
Swaps cases, lower case becomes upper case and vice versa
42
title()
Converts the first character of each word to upper case
43
translate()
Returns a translated string
44
upper()
Converts a string into upper case
45
zfill()
Fills the string with a specified number of 0 values at the beginning