🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Structured Outputs: all 10 questions

Quiz: Structured Outputs · Question 7 of 10

What does this print? (code)

What does this print?

import json
row = json.loads('{"name": "Priya", "cgpa": 8.4, "graduation_year": 2025}')
print(type(row["cgpa"]).__name__, type(row["graduation_year"]).__name__)
  1. A.str str
  2. B.float float
  3. C.float int
  4. D.int int
Answer & explanation

Correct answer: float int

JSON numbers with a decimal point become float; whole numbers become int.

Can you get the rest right without peeking?

Take the timed Quiz: Structured Outputs quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →