Python Strings Flashcards

1
Q

True or False: strings are arrays

A

True

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

Can you loop through characters in a string?

A

Yes

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

What functions do I use to get the length of a string?

A

len()

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

What keyword can I use to check if a certain phrase or character is in a string?

A

‘in’

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

What is the opposite of the ‘in’ phrase?

A

‘not in’

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

What function returns the upper-case version of a string?

A

upper()

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

What functions returns the lower-case version of a string?

A

lower()

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

What function removes any whitespace from the beginning or end of a string?

A

strip()

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

What function replaces a string with another string?

A

replace()

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

What function returns a list where the text between the specified separator becomes the list items?

A

split()

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

What operator is used to concatenate strings?

A

’+’ operator

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

What function allows you to combine numbers and strings?

A

format()

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

What is the escape character?

A

’/’

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