Answers for "if not last element in list python"

3

check if is the last element in list python

if x == my_list[-1]:
    # do what you want
Posted by: Guest on August-28-2020
0

python last item in list

some_list = [1,2,3]
some_list[-1] is the shortest and most Pythonic.
#output = 3
Posted by: Guest on August-03-2021

Code answers related to "if not last element in list python"

Python Answers by Framework

Browse Popular Code Answers by Language