A

Admin • 833K Points
Coach

Q. What is the output of this code?

Code:
print([1, 2, 3] * 3)
  • (A) [3, 6, 9]
  • (B) [1, 2, 3, 1, 2, 3, 1, 2, 3]
  • (C) [[1, 2, 3], [1, 2, 3], [1, 2, 3]]
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

Multiplying a list repeats its elements.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.