Exam 9: Dictionaries and Sets

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

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

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

A

Sets are created using curly braces {}.

Free
(True/False)
4.9/5
(86)
Correct Answer:
Verified

False

The _______________ method clears the contents of a dictionary.

Free
(Short Answer)
4.8/5
(81)
Correct Answer:
Verified

clear

Which statement would you use to delete an existing key-value pair from a dictionary?

(Multiple Choice)
4.9/5
(64)

Sets are immutable.

(True/False)
4.9/5
(81)

Which method would you use to return the value associated with a specified key and remove that key-value pair from the dictionary?

(Multiple Choice)
4.8/5
(74)

The index of the first element in a set is 0.

(True/False)
4.9/5
(83)

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

(Short Answer)
4.8/5
(85)

Which of the following does not apply to sets?

(Multiple Choice)
4.8/5
(88)

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

(Multiple Choice)
4.8/5
(81)

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

(True/False)
4.9/5
(83)

What would be the result of the following code? Ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 } Value = ages['Brianna']

(Multiple Choice)
5.0/5
(74)

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

(Short Answer)
4.8/5
(78)

What is the number of the first index in a list dictionary?

(Multiple Choice)
4.8/5
(77)

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

(Multiple Choice)
4.8/5
(86)

To write an object to a file, you use the _______________ function of the _______________ module.

(Short Answer)
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
(73)

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

(Short Answer)
4.7/5
(85)

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

(Multiple Choice)
4.8/5
(82)

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

(True/False)
4.8/5
(80)
Showing 1 - 20 of 35
close modal

Filters

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