Exam 8: More About Strings
Exam 1: Introduction to Computers and Programming36 Questions
Exam 2: Input, Processing, and Output35 Questions
Exam 3: Decision Structures and Boolean Logic35 Questions
Exam 4: Repetition Structures34 Questions
Exam 5: Functions and Modules69 Questions
Exam 6: Files and Exceptions34 Questions
Exam 7: Lists and Tuples35 Questions
Exam 8: More About Strings35 Questions
Exam 9: Dictionaries and Sets35 Questions
Exam 10: Classes and Object Oriented Programming35 Questions
Exam 11: Inheritance35 Questions
Exam 12: Recursion35 Questions
Exam 13: GUI Programming35 Questions
Select questions type
What will be assigned to the string variable even after the execution of the following code?
Special = '0123456789'
Even = special[0:10:2]
Free
(Multiple Choice)
4.9/5
(70)
Correct Answer:
C
Indexing of a string starts at 1, so the index of the first character is 1, the index of the second character is 2, and so forth.
Free
(True/False)
4.9/5
(73)
Correct Answer:
False
Which of the following string methods can be used to determine if a string contains only '\n' characters?
Free
(Multiple Choice)
4.8/5
(95)
Correct Answer:
D
If the + operator is used on strings, it produces a string that is the combination of the two strings used as its operands.
(True/False)
4.7/5
(68)
Which list will be referenced by the variable list_strip after the execution of the following code?
List_string = '03/07/2008'
List_strip = list_string.split('/')
(Multiple Choice)
4.9/5
(90)
Which method would you use to determine whether a substring is present in a string?
(Multiple Choice)
4.9/5
(74)
The strip() method returns a copy of the string with all leading whitespace characters removed, but does not remove trailing whitespace characters.
(True/False)
4.9/5
(81)
Each character in a string has a(n) _______________ which specifies its position in the string.
(Short Answer)
4.8/5
(88)
What will be assigned to s_string after the execution of the following code?
Special = '1357 Country Ln.'
S_string = special[ :4]
(Multiple Choice)
4.9/5
(84)
Which method would you use to determine whether a substring is the suffix of a string?
(Multiple Choice)
4.9/5
(81)
If a whole paragraph is included in a single string, the split() method can be used to obtain a list of the sentences included in the paragraph.
(True/False)
4.8/5
(88)
What will be assigned to s_string after the execution of the following code?
Special = '1357 Country Ln.'
S_string = special[4: ]
(Multiple Choice)
4.7/5
(81)
The _______________ method returns a copy of the string with all alphabetic letters converted to lower case.
(Short Answer)
4.7/5
(75)
When the operand on the left side of the * symbol is a string and the operand on the right side is an integer, it becomes the _______________ operator.
(Short Answer)
4.8/5
(76)
The _______________ method returns the list of the words in the string.
(Short Answer)
4.9/5
(80)
In slicing, if the end index specifies a position beyond the end of the string, Python will use the length of the string instead.
(True/False)
4.8/5
(75)
Strings are _______________, which means that once a string is created, it cannot be changed.
(Short Answer)
4.7/5
(78)
Showing 1 - 20 of 35
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)