What is output of the code in Python Language: >>> str1 = 'All the Best'
What is output of the code in Python Language:
>>> str1 = 'All the Best'
>>> str1[-3]
Show answerHide answer
Correct answer: (B) 'e'
Explanation
'All the Best' has 12 characters, so index −3 is index 9. Indexes 8-11 are B, e, s, t, so str1[-3] is 'e'.