← Quiz: Python Variables and Data Types: all 15 questions
Quiz: Python Variables and Data Types · Question 1 of 15
What is the output? (code)
What is the output?
x = "5"
y = 2
print(x * y)
- A.10
- B.55
- C.TypeError
- D.7
Answer & explanation
Correct answer: 55
Multiplying a string by an integer repeats it: "5" * 2 = "55".
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 →