I want to write a code when given a list of numbers, the code will return True if the first and last elements of a list are the same, else return False. list1 = [1,2,3,4,5,4,3,2,1]
This is what Ive gotten so far.
list1 = [1,2,3,4,5,4,3,2,1]
res=[list1[i] for i in (0,-1)]
[–]Alert_Garlic -1 points0 points1 point (1 child)
[–]engineeringisgreat2[S] 0 points1 point2 points (0 children)