A

Admin • 832.27K Points
Coach

Q. What will this code output?

Code:
print('Hello'[::-1])
  • (A) Hello
  • (B) olleH
  • (C) Error
  • (D) None
  • Correct Answer - Option(B)
  • Views: 14
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

The slice with step -1 reverses the string.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.