What will be the output of the following code?
list1=[2,33,222,14,25]
print(list1[-1]) Qus
निम्नलिखित कोड का आउटपुट क्या होगा?
list1=[2,33,222,14,25] print(list1[-1])
A. 2
B. 33
C. 14
D. 25
Solution
D. 25Explanation
in python list index start with 0 1 2 and the reverse index start from -1, -2 so on (from the end of list) so list1[-1] return the first element from right of list (last element from left)