Cisco
200-901 · Question #423
What is used in JSON to represent a Python tuple?
The correct answer is C. array. JSON has no native tuple type. Since a Python tuple is an ordered, immutable sequence of values, it maps to a JSON array ([ ]) when serialized. The json module in Python automatically converts both lists and tuples to JSON arrays. JSON objects ({}) represent key-value mappings…
Software Development and Design
Question
What is used in JSON to represent a Python tuple?
Options
- Acollection
- Bobject
- Carray
- Ddict
How the community answered
(26 responses)- A4% (1)
- B8% (2)
- C88% (23)
Explanation
JSON has no native tuple type. Since a Python tuple is an ordered, immutable sequence of values, it maps to a JSON array ([ ]) when serialized. The json module in Python automatically converts both lists and tuples to JSON arrays. JSON objects ({}) represent key-value mappings (like Python dicts), not ordered sequences.
Topics
#JSON#Python#Data Structures#Serialization
Community Discussion
No community discussion yet for this question.