← Quiz: Python Variables and Data Types: all 15 questions
Quiz: Python Variables and Data Types · Question 11 of 15
What does this print? (code)
What does this print?
print(int("12") + float("0.5"))
- A.120.5
- B.12.5
- C."12" + "0.5"
- D.An error
Answer & explanation
Correct answer: 12.5
Both strings are converted to numbers first, so this is 12 + 0.5.
Can you get the rest right without peeking?
Take the timed Quiz: Python Variables and Data Types quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →