python last element of list using reverse 28 29 function

Solutions on MaxInterview for python last element of list using reverse 28 29 function by the best coders in the world

showing results for - "python last element of list using reverse 28 29 function"
Caterina
15 Feb 2018
1# Python code to access the last element
2# in a list using reverse() method
3  
4# Declaring and  initializing list 
5number_list = [2, 1, 7, 4, 5, 3,6]
6  
7print ("List of elements are : " + str(number_list))
8
9# using reverse method to print last element
10number_list.reverse()
11print("The last element of list using reverse method are : "
12                            +  str(number_list[0]))
13
similar questions