Exam 8: Lists and Tuples
Exam 1: Introduction to Computers and Programming35 Questions
Exam 2: Input, Processing, and Output35 Questions
Exam 3: Simple functions34 Questions
Exam 4: Decision Structures and Boolean Logic35 Questions
Exam 5: Repetition Structures35 Questions
Exam 6: Value-Returning functions and Modules35 Questions
Exam 7: files and Exceptions35 Questions
Exam 8: Lists and Tuples35 Questions
Exam 9: More About Strings35 Questions
Exam 10: Dictionaries and Sets35 Questions
Exam 11: Classes and Object-Oriented Programming35 Questions
Exam 12: Inheritance35 Questions
Exam 13: Recursion35 Questions
Exam 14: GUI Programming35 Questions
Select questions type
What are the data items in the list called?
Free
(Multiple Choice)
4.9/5
(47)
Correct Answer:
B
The _______________ method is commonly used to add items to a list.
Free
(Short Answer)
4.8/5
(31)
Correct Answer:
append
The _______________ method reverses the order of the items in the list.
Free
(Short Answer)
4.8/5
(35)
Correct Answer:
reverse
Lists are _______________, which means their elements can be changed.
(Short Answer)
4.7/5
(38)
What would be the value of the variable list2 after the execution of the following code? list1 = [1, 2, 3]
List2 = []
For element in list1
List2.append(element)
List1 = [4, 5, 6]
(Multiple Choice)
4.8/5
(43)
The sort method rearranges the elements of a list so they appear in ascending or descending order.
(True/False)
4.8/5
(40)
Lists are dynamic data structures such that items may be added to them or removed from them.
(True/False)
4.8/5
(38)
The _______________ function returns the item that has the lowest value in the sequence.
(Short Answer)
4.7/5
(38)
The _______________ exception is raised when a search item is not in the list being searched.
(Short Answer)
4.8/5
(33)
Each element in a tuple has a(n) _______________ that specifies its position in the tuple.
(Short Answer)
4.9/5
(35)
The remove method removes all occurrences of the item from a list.
(True/False)
4.9/5
(40)
Indexing starts at 1, so the index of the first element is 1, the index of the second element is 2, and so forth.
(True/False)
4.7/5
(28)
When working with multiple sets of data, one would typically use a(n) _____.
(Multiple Choice)
4.9/5
(24)
What would be the value of the variable list after the execution of the following code? list = [1, 2]
List = list * 3
(Multiple Choice)
4.9/5
(38)
A(n) _______________ is a span of items that are taken from a sequence.
(Short Answer)
4.8/5
(46)
Invalid indexes do not cause slicing expressions to raise an exception.
(True/False)
4.8/5
(39)
Tuples are _______________ sequences, which means that once a tuple is created, it cannot be changed.
(Short Answer)
4.8/5
(37)
Showing 1 - 20 of 35
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)