Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
python last element of list 1

python last element of list

June 16, 2022 by Anurag batra
l = [1,2,3,4,5]
last = l[len(l)-1]

Here is what the above code is Doing:
1. We create a list called l.
2. We create a variable called last and set it equal to the last element of the list l.
3. We print the value of last.

Categories Python Examples
Post navigation
scapy python functions
how to write a numpy array to a file in python
© MyEduKit - 2022 . All Rights Reserved.