A

Admin • 832.70K Points
Coach

Q. What will be the output?

Code:
print('1' + '2' * 3)
  • (A) 123
  • (B) 1222
  • (C) 126
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

'2' * 3 becomes '222'; concatenated with '1' gives '1222'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.