Write a Python function that Given a list of numbers, return True if first and last number of a list is same


Topic: Write a Python function that Given a list of numbers, return True if first and last number of a list is same

Solution

def isFirst_And_Last_Same(numberList):
    firstElement = numberList[0]
    lastElement = numberList[-1]
    if (firstElement == lastElement):
        return True
    else:
        return False



List all Python Programs