← 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__)
- A.str str
- B.float float
- C.float int
- 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 →