Advertisements
Advertisements
Question
What will be the output of the following statement?
list1 = [1,2,3,4,5]
list1[len(list1)-1]Short/Brief Note
Advertisements
Solution
This will print the last element of the list. i.e. 5
list1[len(list1)-1]
list1[5-1]
list1[4]
5shaalaa.com
Lists in Python
Is there an error in this question or solution?
