String Methods Flashcards

(68 cards)

1
Q

capitalize()

A

converts first character to capital letter

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

center()

A

pads string with specified character

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

casefold()

A

converts to casefolded strings

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

count()

A

returns occurences of substring in string

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

endswith()

A

checks if string end with the specified suffix

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

expandtabs()

A

replaces tab character with spaces

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

encode()

A

returns encoded string of given string

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

find()

A

returns highest index of substring

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

format()

A

formats string into nicer output

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

index()

A

returns index of substring

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

isalnum()

A

checks alphanumeric character

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

isalpha()

A

checks if all characters are alphabets

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

isdecimal()

A

checks decimal characters

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

isdigit()

A

checks digit characters

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

isidentifier()

A

checks for valid identifier

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

islower()

A

checks if all alphabets in a string are lowercase

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

isnumeric()

A

checks numeric characters

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

isprintable()

A

checks printable character

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

isspace()

A

checks whitespace characters

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

istitle()

A

checks for titlecased string

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

isupper()

A

returns if all characters are uppercase characters

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

join()

A

returns a concatenated string

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

ljust()

A

returns left-justified string of given width

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

rjust()

A

returns right-justified string of a given width

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
lower()
returns lowercased string
26
upper()
returns uppercased string
27
swapcase()
swap uppercase characters to lowercase; vice versa
28
lstrip()
removes leading characters
29
rstrip()
removes trailing characters
30
strip()
removes both leading and trailing characters
31
partitiion()
returns a tuple
32
maketrans()
returns a translation table
33
rpartition()
returns a tuple
34
translate()
returns mapped charactered string
35
replace()
replaces substring inside
36
rfind()
returns the highest index of substring
37
rindex()
returns highest index of substring
38
split()
splits string from left
39
rsplit()
splits string from right
40
splitlines()
splits string at line boundaries
41
startswith()
checks if string starts with specified string
42
title()
returns a title cased string
43
zfill()
returns a copy of the string padded with zeros
44
format_map()
formates the string using dictionary
45
any()
checks if any element of an iterable is true
46
all()
returns true when all elements in iterable is true
47
ascii()
returns string containing printable representation
48
bool()
convers a value to Boolean
49
bytearray()
returns array of given byte size
50
bytes()
returns immutable bytes object
51
compile()
returns a python code object
52
complex()
creates a complex number
53
enumerate()
returns an enumerate object
54
filter()
constructs iterator from elements which are true
55
float()
returns floating point number from number, string
56
input()
reads and returns a line of string
57
int()
returns integer from a number or string
58
iter()
returns iterator for an object
59
len()
returns length of an object
60
max()
returns largest element
61
min()
returns smallest element
62
map()
applies function and returns a list
63
ord()
returns unicode code point for unicode character
64
reversed()
returns reversed iterator of a sequence
65
slice()
creates a slice object specified by range()
66
sorted()
returns sorted list from a given iterable
67
sum()
add items of an iterable
68
zip()
returns an iterator of tuples