Find last element in List

L = [1,2,3,4,5,6,7,45]

print(L[-1:])

Output

[45]

Published by Python programming examples for beginners

Abhay Gadkari is an IT professional having around experience of 20+ years in IT industry. He worked on web technologies and databases with Insurance and ERP projects.