getting the last item of list python
- Last modified: 20 February 2020
- Category: python tutorial
syntax
1 | your_list[-1] |
example
1 2 3 | a_list= ['elephant', 'dog', 'cat', 'zebra'] print(a_list[-1]) |
output
1 | zebra
|
English today is not an art to be mastered it's just a tool to use to get a result