how can I compare values of list with the function values by only using the if condition in python?

here is my code and I’m not getting the logic, how can I Compare them. so that; If the value doesn’t exist already, it should be added and the function should return True. If the value does exist, it should not be added, and the function should return False;

 myUniqueList = [1,2,3]
 myLeftovers  = [] 

def Values_List (value) :
    myUniqueList.append(value)
    if value == [value]:
       print (False)
    else:
        print (True)
    print (myUniqueList)

print (myUniqueList)
Values_List(2)

Answer

You may code exactly what you explained

def Values_List(value):
    if value in myUniqueList:   # if value already in the list
        return False            # return False
    myUniqueList.append(value)  # else add it to the list
    return True                 # and return True

myUniqueList = [1, 3]
print(myUniqueList)    # [1, 3]
print(Values_List(2))  # True
print(myUniqueList)    # [1, 2, 3]