What is the output of print('Python'[::-1]) in Python?
print('Python'[::-1])
Correct answer
C. nohtyP
6 views
C. nohtyP
6 views
The slice [::-1] reverses a sequence.
Asked in: Python Interview Strings
https://docs.python.org/3/library/stdtypes.html#string-methodsNot sure why the answer is C? Ask here and get an explanation.