Exam 7: Lists and Tuples
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 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]
Free
(Multiple Choice)
4.9/5
(35)
Correct Answer:
A
Arrays, which most other programming languages allow, have much more capabilities than list structures.
Free
(True/False)
4.9/5
(35)
Correct Answer:
False
What would be the value of the variable list2 after the execution of the following code?
List1 = [1, 2, 3]
List2 = list1
List1 = [4, 5, 6]
Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
B
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.8/5
(41)
The _______________ method is commonly used to add items to a list.
(Short Answer)
4.9/5
(32)
Each element in a tuple has a(n) _______________ that specifies its position in the tuple.
(Short Answer)
4.9/5
(30)
Tuples are _______________ sequences, which means that once a tuple is created, it cannot be changed.
(Short Answer)
4.8/5
(43)
The remove method removes all occurrences of the item from a list.
(True/False)
4.9/5
(38)
The sort method rearranges the elements of a list so they appear in ascending or descending order.
(True/False)
4.9/5
(34)
The primary difference between a tuple and list is that _____.
(Multiple Choice)
4.9/5
(35)
When working with multiple sets of data, one would typically use a(n) _____.
(Multiple Choice)
4.7/5
(40)
Which list will be referenced by the variable number after the execution of the following code?
Number = range(0, 9, 2)
(Multiple Choice)
4.9/5
(32)
Lists are _______________, which means their elements can be changed.
(Short Answer)
4.9/5
(43)
Showing 1 - 20 of 35
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)