When I run the code without the 'is True' code at the end of my elif statement, the correct list is produced; however, when I add it, an empty list is printed. I have also tried equating the if statement to the boolean True; however, that too doesn't work (and PyCharm tells me that there is a minor error - amber). I want to understand why this is happening.
numbers_list = [5, 2, 546, 7, 3, 5, 2, 7, 29, 6, 5, 7]
uniques = []
for number in numbers_list:
if number in uniques:
continue
elif number not in uniques is True:
uniques.insert(-1, number)
print(uniques)