Strings: A Deeper Look Flashcards

1
Q

(Fill-In) Presentation types _____ and _____ format floating-point and Decimal values in scientific notation.

A

e, E.

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

(Fill-In) Presentation type _____ formats a character code as its corresponding character.

A

c.

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

(True/False) If you do not specify the alignment, all values displayed in a field are right-aligned by default.

A

False. Only numeric values are right aligned by default.

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

(Fill-In) To display all numeric values with their sign, use a(n) _____ in the format specifier; to display a space rather than a sign for positive values use a(n) _____ instead.

A

+, space character.

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

(Fill-In) Method _____ returns the number of times a given substring occurs in a string.

A

count.

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

(True/False) String method find causes a ValueError if it does not find the specified substring.

A

False. String method find returns -1 in this case. String method index causes a ValueError.

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

(Fill-In) Tokens are separated from one another by _____.

A

delimiters.

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

(Fill-In) Method ________ returns True if a string contains only letters and numbers.

A

isalnum.

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

(Fill-In) Method ________ returns True if a string contains only letters

A

isalpha.

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

(Fill-In) The raw string r’\Hi!\’ represents the regular string _____.

A

’\\Hi!\\’

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

(True/False) Any string can be a regular expression.

A

True.

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

(True/False) The ? quantifier matches exactly one occurrence of a subexpression.

A

False. The ? quantifier matches zero or one occurrences of a subexpression.

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

(True/False) The character class [^0–9] matches any digit.

A

False. The character class [^0–9] matches anything that is not a digit.

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

(Fill-In) Function ________ finds in a string the first substring that matches a regular expression.

A

search.

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

(Fill-In) Preparing data for analysis is called _____ or _____. A subset of this process is data cleaning.

A

data munging, data wrangling.

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