Exam 8: Lists and Tuples

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

In slicing, if the end index specifies a position beyond the end of the list, Python will use the length of the list instead.

(True/False)
4.9/5
(40)

The built-in function _______________ returns the length of a sequence.

(Short Answer)
4.8/5
(35)

What would be the value of the variable list after the execution of the following code? list = [1, 2, 3, 4] List[3] = 10

(Multiple Choice)
5.0/5
(36)

A(n) _______________ is an object that holds multiple items of data.

(Short Answer)
4.8/5
(48)

What would you use if an element is to be removed from a specific index?

(Multiple Choice)
4.8/5
(40)

The index - 1 identifies the last element in a list.

(True/False)
4.8/5
(31)

A list cannot be passed as an argument to a function.

(True/False)
4.9/5
(41)

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

(Multiple Choice)
4.8/5
(36)

What is the advantage of using tuples over lists?

(Multiple Choice)
4.9/5
(38)

What method can be used to place an item in the list at a specific index?

(Multiple Choice)
4.8/5
(34)

Which list will be referenced by the variable number after the execution of the following code? number = range(0, 9, 2)

(Multiple Choice)
4.8/5
(44)

The primary difference between a tuple and list is that _____.

(Multiple Choice)
4.9/5
(30)

Arrays, which most other programming languages allow, have much more capabilities than list structures.

(True/False)
4.9/5
(37)

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]

(Multiple Choice)
4.7/5
(37)

The first step in calculating the average of the values in a list is to get the total of the values.

(True/False)
4.8/5
(34)
Showing 21 - 35 of 35
close modal

Filters

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