← 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?
- A.print(int("85") + 5)
- B.print("85" + 5)
- C.print("85" + str(5))
- 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 →