← 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?
- A.9
- B.45
- C.4 5
- 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 →