String Methods Flashcards

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
Q

lower()

A

returns lowercased string

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

upper()

A

returns uppercased string

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

swapcase()

A

swap uppercase characters to lowercase; vice versa

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

lstrip()

A

removes leading characters

29
Q

rstrip()

A

removes trailing characters

30
Q

strip()

A

removes both leading and trailing characters

31
Q

partitiion()

A

returns a tuple

32
Q

maketrans()

A

returns a translation table

33
Q

rpartition()

A

returns a tuple

34
Q

translate()

A

returns mapped charactered string

35
Q

replace()

A

replaces substring inside

36
Q

rfind()

A

returns the highest index of substring

37
Q

rindex()

A

returns highest index of substring

38
Q

split()

A

splits string from left

39
Q

rsplit()

A

splits string from right

40
Q

splitlines()

A

splits string at line boundaries

41
Q

startswith()

A

checks if string starts with specified string

42
Q

title()

A

returns a title cased string

43
Q

zfill()

A

returns a copy of the string padded with zeros

44
Q

format_map()

A

formates the string using dictionary

45
Q

any()

A

checks if any element of an iterable is true

46
Q

all()

A

returns true when all elements in iterable is true

47
Q

ascii()

A

returns string containing printable representation

48
Q

bool()

A

convers a value to Boolean

49
Q

bytearray()

A

returns array of given byte size

50
Q

bytes()

A

returns immutable bytes object

51
Q

compile()

A

returns a python code object

52
Q

complex()

A

creates a complex number

53
Q

enumerate()

A

returns an enumerate object

54
Q

filter()

A

constructs iterator from elements which are true

55
Q

float()

A

returns floating point number from number, string

56
Q

input()

A

reads and returns a line of string

57
Q

int()

A

returns integer from a number or string

58
Q

iter()

A

returns iterator for an object

59
Q

len()

A

returns length of an object

60
Q

max()

A

returns largest element

61
Q

min()

A

returns smallest element

62
Q

map()

A

applies function and returns a list

63
Q

ord()

A

returns unicode code point for unicode character

64
Q

reversed()

A

returns reversed iterator of a sequence

65
Q

slice()

A

creates a slice object specified by range()

66
Q

sorted()

A

returns sorted list from a given iterable

67
Q

sum()

A

add items of an iterable

68
Q

zip()

A

returns an iterator of tuples