could you please help me with the following?:
I need a code that returns True if the first and last numbers in a list are the same or False if the numbers are different.
def first_last_same(numberList):
print("On the list:", numberList)
#Here the code#
I need when i print
print("The first and last numbers in the list are the same", first_last_same([10, 20, 30, 40, 10]))
print("The first and last numbers in the list are the same", first_last_same([57, 22, 35, 57, 22, 57]))
Generate the following result
On the list: [10, 20, 30, 40, 10]
The first and last numbers in the list are the same True
On the list: [57, 22, 35, 57, 22, 58]
The first and last numbers in the list are the same False
Please, help.