Exam 9: Dictionaries and Sets

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

The elements in a dictionary are stored in ascending order,by the keys of the key-value pairs.

(True/False)
4.7/5
(76)

The __________ method clears the contents of a dictionary.

(Short Answer)
4.8/5
(81)

The set remove and discard methods behave differently only when a specified item is not found in the set.

(True/False)
4.8/5
(64)

To add a single item to a set,you can use the set __________ method.

(Short Answer)
4.8/5
(62)

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

(Multiple Choice)
4.9/5
(80)

What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.) What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.)

(Multiple Choice)
5.0/5
(86)

Each element in a dictionary view is a __________.

(Short Answer)
5.0/5
(86)

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

(Multiple Choice)
4.8/5
(75)

Which of the following does not apply to sets?

(Multiple Choice)
4.9/5
(93)

What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.) What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.)

(Multiple Choice)
4.9/5
(68)

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

(Short Answer)
4.7/5
(78)

In a dictionary,you use a(n)__________ to locate a specific value.

(Multiple Choice)
4.8/5
(67)

What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.) What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in a specific order.)

(Multiple Choice)
4.8/5
(75)

Which method would you use to get all the elements in a dictionary returned as a list of tuples?

(Multiple Choice)
4.8/5
(76)

To determine whether or not a key is included in a dictionary,or if an element is included in a set,you can use the ___________ operator.

(Short Answer)
4.8/5
(81)

The __________ method returns a value associated with a specific key and,if found,removes that key-value pair from the dictionary.

(Short Answer)
4.9/5
(78)

If you try to retrieve a value from a dictionary using a nonexistent key,a KeyError exception is raised.

(True/False)
4.9/5
(70)

The issubset()method can be used to determine whether set1 is a subset of set2.

(True/False)
4.9/5
(79)

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

(Short Answer)
4.8/5
(83)
Showing 21 - 39 of 39
close modal

Filters

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