SyntaxFix
Write A Post
Hire A Developer
Questions
Did you mean len(list1)-1?
len(list1)-1
If you're searching for other method, you can try list1.index(list1[-1]), but I don't recommend this one. You will have to be sure, that the list contains NO duplicates.
list1.index(list1[-1])