← Quiz: Exceptions and Files: all 15 questions
Quiz: Exceptions and Files · Question 15 of 15
What does json.load(f) give you for a file containing {"name": "Asha", "cgpa": 8.7}?
What does json.load(f) give you for a file containing {"name": "Asha", "cgpa": 8.7}?
- A.A string
- B.A list of lines
- C.A Python dictionary
- D.A tuple
Answer & explanation
Correct answer: A Python dictionary
JSON objects become dictionaries, so you can write data["name"].
Can you get the rest right without peeking?
Take the timed Quiz: Exceptions and Files quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →