Exam 7: Lists and Tuples

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

Lists are ___________,which means their elements can be changed in a program.

Free
(Short Answer)
4.9/5
(84)
Correct Answer:
Verified

mutable

Invalid indexes do not cause slicing expressions to raise an exception.

Free
(True/False)
4.8/5
(80)
Correct Answer:
Verified

True

What will be the output after the following code is executed? What will be the output after the following code is executed?

Free
(Multiple Choice)
4.7/5
(82)
Correct Answer:
Verified

D

In order to create graphs using the matplotlib package,you need to import the pyplot module.

(True/False)
4.9/5
(68)

Arrays,which are allowed by most other programming languages,have more capabilities than Python list structures.

(True/False)
4.7/5
(68)

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

(Multiple Choice)
5.0/5
(87)

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

(Multiple Choice)
4.7/5
(84)

The ___________ function can be used to convert a list to a tuple.

(Short Answer)
4.8/5
(77)

The __________ exception is raised when a search item is not in the list being searched.

(Short Answer)
4.8/5
(88)

What will be the value of the variable list2 after the following code executes? What will be the value of the variable list2 after the following code executes?

(Multiple Choice)
4.9/5
(80)

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

(Short Answer)
4.8/5
(84)

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

(Short Answer)
4.7/5
(67)

The remove method removes all occurrences of an item from a list.

(True/False)
5.0/5
(74)

What is an advantage of using a tuple rather than a list?

(Multiple Choice)
4.7/5
(76)

The index of the first element in a list is 1,the index of the second element is 2,and so forth.

(True/False)
4.8/5
(77)

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

(Short Answer)
4.9/5
(83)

Which of the following would you use if an element is to be removed from a specific index?

(Multiple Choice)
4.9/5
(81)

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

(Multiple Choice)
4.9/5
(86)

The primary difference between a tuple and a list is that

(Multiple Choice)
4.7/5
(96)

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

(True/False)
4.8/5
(63)
Showing 1 - 20 of 40
close modal

Filters

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