Answers for "python select last item in list"

13

python last element of list

print(list[-1])
Posted by: Guest on May-27-2020
1

python select last item in list

# Basic syntax:
your_list[-1]

# Example usage:
your_list = [1, 'amazing', 'list']
your_list[-1]
--> 'list'
Posted by: Guest on November-17-2020

Code answers related to "python select last item in list"

Python Answers by Framework

Browse Popular Code Answers by Language