Q. What will be the output of the following Python code: print('Hello' * 3)?

  • (A) HelloHelloHello
  • (B) Hello 3
  • (C) Hello
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) HelloHelloHello
Explanation: In Python, multiplying a string by a number repeats the string that many times. So 'Hello' * 3 will output 'HelloHelloHello'.
Explanation by: Ranjeet
In Python, multiplying a string by a number repeats the string that many times. So 'Hello' * 3 will output 'HelloHelloHello'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
172
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Ranjeet
Publisher
πŸ“ˆ
87%
Success Rate