Exam 10: Dictionaries and Sets

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

You would typically use a for loop to iterate over the elements in a set.

(True/False)
4.9/5
(89)

In order to avoid KeyError exceptions, you can check whether a key is in the dictionary using the _____ operator.

(Multiple Choice)
4.8/5
(75)

Sets are created using curly braces {}.

(True/False)
4.8/5
(81)

Which function would you use to get the number of elements in a dictionary?

(Multiple Choice)
4.9/5
(74)

The union of two sets is a set that contains only the elements that appear in both sets.

(True/False)
4.9/5
(85)

The _______________ method clears the contents of a dictionary.

(Short Answer)
4.9/5
(69)

What does the get method do if the specified key is not found in the dictionary?

(Multiple Choice)
4.8/5
(80)

The _______________ of two sets is a set that contains all the elements of both sets.

(Short Answer)
4.8/5
(88)

What method can be used to add a group of elements to a set?

(Multiple Choice)
5.0/5
(66)

Each element in a(n) _______________ has two parts: a key and a value.

(Short Answer)
5.0/5
(95)

The elements in a dictionary are not stored in a specific order. Therefore a dictionary is not a(n) _______________.

(Short Answer)
4.8/5
(64)

A(n) _______________ is an object that holds multiple unique items of data in an unordered manner.

(Short Answer)
4.8/5
(72)

A dictionary can include the same value several times, but cannot include the same key several times.

(True/False)
4.9/5
(74)

The built-in function _______________ returns the number of items in a set.

(Short Answer)
4.8/5
(73)

What is the process used to convert an object to a stream of bytes that can be saved in a file?

(Multiple Choice)
4.9/5
(87)
Showing 21 - 35 of 35
close modal

Filters

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