Answers for "if the last record 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
1

python get last item in a list

my_list = ["I", "Love", "Python"]
last_item_in_list = my_list[-1]
# last_item_in_list = "Python"
Posted by: Guest on January-15-2021

Code answers related to "if the last record in list python"

Python Answers by Framework

Browse Popular Code Answers by Language