🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Variables and Data Types: all 15 questions

Quiz: Python Variables and Data Types · Question 12 of 15

Which line gives a TypeError?

Which line gives a TypeError?

  1. A.print(int("85") + 5)
  2. B.print("85" + 5)
  3. C.print("85" + str(5))
  4. D.print(float("85") + 5)
Answer & explanation

Correct answer: print("85" + 5)

You cannot add text and a number; the other three convert one side first.

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 →