What is the output of the following code ?
>>> s = ['python', 'is', 'easy', 'programming', 'language'] >>> s[:-1][-1]
'python'
'is'
'easy'
'programming'
s[:-1] will give us ['python', 'is', 'easy', 'programming'].
Hence [-1] index of ['python', 'is', 'easy', 'programming'], will be 'programming'
Comment here: