What is the output of print('Python'[1:4]) in Python?
print('Python'[1:4])
Correct answer
A. yth
5 views
A. yth
5 views
Slicing [1:4] returns characters from index 1 up to but not including 4.
Asked in: Python Interview Strings
https://docs.python.org/3/library/stdtypes.html#string-methodsNot sure why the answer is A? Ask here and get an explanation.