Exam 8: Lists and Tuples

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What are the data items in the list called?

Free
(Multiple Choice)
4.9/5
(47)
Correct Answer:
Verified

B

The _______________ method is commonly used to add items to a list.

Free
(Short Answer)
4.8/5
(31)
Correct Answer:
Verified

append

The _______________ method reverses the order of the items in the list.

Free
(Short Answer)
4.8/5
(35)
Correct Answer:
Verified

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)

What is the first negative index in a list?

(Multiple Choice)
4.7/5
(45)

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)

What method or operator can be used to concatenate lists?

(Multiple Choice)
4.9/5
(37)

What method can be used to convert a list to a tuple?

(Multiple Choice)
4.8/5
(33)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)