Python Select Last Item In List

[Solved] Python Select Last Item In List | Haskell - Code Explorer | yomemimo.com
Question : get the last element from the list

Answered by : glorious-gentoo-5cxllfulsdia

lst = [2, 5 , 6, 3, 8, 9]
n = len(lst) #get the length
last_el = lst[n-1] #get the last element
print("The last element of the list is:", last_el)

Source : https://maschituts.com/get-the-last-element-of-a-list-in-python/ | Last Update : Fri, 07 Jan 22

Question : get the last item in a python list

Answered by : jack-roy

# Get the last element in a List
list = ["A", "B", "C"]
print(list[-1])

Source : | Last Update : Tue, 03 May 22

Answers related to python select last item in list

Code Explorer Popular Question For Haskell