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

Quiz: Python Operators and Input · Question 13 of 14

A user types 4 and then 5 for a = input() and b = input(). What does print(a + b) show?

A user types 4 and then 5 for a = input() and b = input(). What does print(a + b) show?

  1. A.9
  2. B.45
  3. C.4 5
  4. D.An error
Answer & explanation

Correct answer: 45

input() returns strings, and + joins strings. Convert with int() to add them as numbers.

Can you get the rest right without peeking?

Take the timed Quiz: Python Operators and Input quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →