ProgrammingModerateGATE CS · Product-company placement

What is printed?

What is printed?
print("10" + "5", int("10") + 5, "10" * 2, str(10) * 2 == "1010", "5" < "10")
  1. A. 105 15 1010 True False
  2. B. 15 15 20 True True
  3. C. 105 15 20 True False
  4. D. 105 15 1010 True True

Correct answer: A. 105 15 1010 True False

+ concatenates strings and * repeats them. String comparison is lexicographic by character: '5' > '1', so '5' < '10' is False.

More Python Programming questions

Exams that ask this topic