ExamGecko
Question list
Search
Search

Question 40 - JN0-223 discussion

Report
Export

Which two statements are correct about a Python dictionary data type? (Choose two.)

A.
The data contained in a dictionary data type cannot be removed once the dictionary has been created.
Answers
A.
The data contained in a dictionary data type cannot be removed once the dictionary has been created.
B.
The data stored in a dictionary data type is sequenced and indexed.
Answers
B.
The data stored in a dictionary data type is sequenced and indexed.
C.
The data contained in a dictionary data type is a key/value pair.
Answers
C.
The data contained in a dictionary data type is a key/value pair.
D.
The data stored in a dictionary data type is not sequenced or indexed.
Answers
D.
The data stored in a dictionary data type is not sequenced or indexed.
Suggested answer: C, D

Explanation:

A Python dictionary is a data type that stores data in the form of key/value pairs. It has the following characteristics:

Key/Value Pair (C): Each entry in a dictionary is a pair consisting of a unique key and a value. The key is used to access the corresponding value.

Not Sequenced or Indexed (D): Unlike lists or tuples, dictionaries do not maintain order for their entries (in versions prior to Python 3.7). Even though Python 3.7+ maintains insertion order, dictionaries are not considered indexed or sequenced in the traditional sense like lists, where elements are accessed via positional index.

Option A is incorrect because dictionary entries can be added, modified, or removed after the dictionary is created. Option B is incorrect because dictionaries are not accessed by a numeric index but rather by their keys.

Python Official Documentation: Details the nature of dictionaries, including their mutability and key/value structure.

Python Data Structures Guide: Explains dictionary operations and characteristics.

asked 18/09/2024
Rodwell Shibambu
51 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first