Part 8
The index of the first item in a string is 1.
False
The index of the last item in a string is the length of the string.
False
"A" < "B" can be used in an if statement and evaluates to True.
True
All string methods, such as upper() and lower() do not actually update the string object. Instead, they make a copy of the string and return the copy.
True
None of the string methods actually update the contents of the string object. Any perceived updates and achieved by making a copy of the string object and returning the copy.
True
Strings can be indicated with double quotes or single quotes.
True
Choose the correct line of code to determine the length of string s1
len(s1)
The string method ____ returns a copy of the string converted to lowercase.
lower
After the following assignment statement has been executed, which expression produce the letter 'w'? s1 = 'hello world'
s1[6]
The string method ____ can be used to obtain a list of the words contained in an input string.
split
When reading input from the user, the data is read into which type:
str
The string method ____ returns a copy of the string with leading and trailing whitespace (tabs, spaces, newlines) removed.
strip
Select the expression(s) that produce True.
"do" in "don't"
You can join two or more strings to form a new string using the concatenation operator ____.
+
Which of the following is used to represent the newline character?
\n
Which of the following is used to represent the tab character?
\t
When concatenating objects, all objects must be what type:
all objects must be str or converted to a str using the str() function