Exam 2: An Overview of Collections

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

A set is a built-in Python collection type.

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

True

When a for loop is used to iterate over a collection, which statement is true?

Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
Verified

C

In Python, modules and methods are the smallest units of abstraction, classes are the next in size, and functions are the largest.

Free
(True/False)
4.7/5
(38)
Correct Answer:
Verified

False

Which real-world item best represents a hierarchical collection?

(Multiple Choice)
4.9/5
(39)

If you clone an object using the = operator (as in myList=list(yourList) ), the is operator returns True while the == operator returns False.

(True/False)
4.7/5
(33)

When using a for loop to iterate over a list, the items are visited in no particular order.

(True/False)
4.8/5
(33)

What is the value of myObject after the following code executes? YourObject = "Hi" MyObject = tuple(yourObject)

(Multiple Choice)
4.9/5
(33)

Which operator is used to obtain a string representation of a collection?

(Multiple Choice)
4.8/5
(40)

A tuple is an immutable collection type.

(True/False)
4.7/5
(31)

Use the & operator to concatenate two collections.

(True/False)
4.7/5
(34)

Which of the following is an unordered collection?

(Multiple Choice)
4.9/5
(32)

What is the value of c after the following code executes? A = [ 10, 20, 30 ] B = [ 40, 50, 60 ] C = a + b

(Multiple Choice)
4.7/5
(42)

The map, filter, and reduce functions can only be used on list collections.

(True/False)
4.8/5
(33)

Which of the following is a special case of type conversion, where the two collections are of the same type?

(Multiple Choice)
4.8/5
(36)

What is the value of aList after the following code is executed? AList = [ 10, 20, 30 ] AList.pop()

(Multiple Choice)
4.8/5
(37)

A sorted collection must be in a linear structure, ordered by position.

(True/False)
4.8/5
(44)

Which statement is true about a sorted collection?

(Multiple Choice)
4.9/5
(45)

Which of the following is true about Python collections?

(Multiple Choice)
4.9/5
(39)

The use of collections is a Python programming requirement, but they are not very useful for working with real-world objects.

(True/False)
4.8/5
(40)

Python includes two implementations of lists: arrays and linked lists.

(True/False)
5.0/5
(35)
Showing 1 - 20 of 50
close modal

Filters

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