Learn to Code via Tutorials on Repl.it!

← Back to all posts
How to Get the Last Element of a List In Python
catchsrinivas

Method 1 – By Iterating all the elements in a list

The most common and straightforward way to get last element in list is through iterating the entire element till it reaches the last element, as shown in repl.

For other ways Checkout the post How to Get the Last Element of a List In Python

Voters
catchsrinivas
Comments
hotnewtop
MrVoo

Actually, the most common and easiest way is listName[-1]

IMayBeMe

@MrVoo I second this

CodingElf66

@MrVoo Haha you're right lol. Tutorial saying wrong stuff.