🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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}?

  1. A.A string
  2. B.A list of lines
  3. C.A Python dictionary
  4. 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 →