Nuttige ingebouwde functies voor strings Flashcards

1
Q

my_string.capitalize()

A

alleen eerste letter van de string in hoofdletter

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

my_string.count(“e”)

A

telt wat je in de haakjes doet

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

my_string.find(“h”)

A

geeft je een indexnummer van de eerste h

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

my_string.index(“e”)

A

gives the first index number where the letter is found

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

my_string.isalnum()

A

checks if sting is only letters and numbers

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

my_string.isalpha()

A

checks if string only letters

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

my_string.isdecimal()

A

all characters in a string a decimal, true or false

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

my_string.isdigit()

A

all characters in a string are numbers, true or false

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

my_string.isidentifier()

A

true als alle characters letters, nummers of _ zijn,
mag niet beginnen met nummer en mag geen spaties hebben

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

my_string.islower()

A

true als alle letters kleine letters zijn

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

my_string.isnumeric()

A

checks if all characters are numbers

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

my_string.isupper()

A

checks if all characters are hoofdletters

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

s.join(list)

A

joins alles aan elkaar met de letter s (die variabele moet
maken)

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

my_string.lower()

A

alles in kleine letters

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

my_string.upper()

A

alles in hoofdletters

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

my_string.rstrip()

A

removes all whitespaces on the right side

16
Q

my_string.lstrip()

A

removes all whitespaces on the left side

17
Q

my_string.replace(“en”, “lol”)

A

replaces it in a string

18
Q

my_string.rfind(“lol”)

A

gives highest index of specified substring

19
Q

my_string.rindex(“e”)

A

gives last index where substring is found

20
Q

my_string.split()

A

splits string into list

20
Q

my_string.splitlines()

A

splits string into list (just 1, not different indexes)

21
Q

my_string.startswith()

A

checks if string starts with the letter you put in

22
Q

my_string.endswith(“!”)

A

checks if string ends with the letter you put in

23
Q

my_string.strip(“e”)

A

removes it the first time it occurs

24
Q

my_string.swapcase()

A

maakt kleine letter hoofdletters en andersom