Report Bug

Qus

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. 25



Explanation

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)

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad