Filters
Question type

Study Flashcards

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Sets are created using curly braces {}.

A) True
B) False

Correct Answer

verifed

verified

The _______________ method clears the contents of a dictionary.

Correct Answer

verifed

verified

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


A) Throw an exception
B) Nothing
C) Return a default value
D) You do not specify a key for the get method

E) None of the above
F) A) and C)

Correct Answer

verifed

verified

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


A) Pickling
B) Streaming
C) Writing
D) Dumping

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

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


A) size
B) length
C) len
D) invalid code

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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


A) add
B) addgroup
C) update
D) Elements must be added one at a time.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


A) included
B) of
C) in
D) not in

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Showing 21 - 35 of 35

Related Exams

Show Answer