🎙 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 1 of 15

What is the output? (code)

What is the output?

x = "5"
y = 2
print(x * y)
  1. A.10
  2. B.55
  3. C.TypeError
  4. 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 →