I know that there are already a lot of questions about this specific topic, but I can't find a proper solution for my problem.
I have the input:
2, 20, 15, 16, 17, 3, 8, 10, 7
I want to see if there are 'double' numbers in my code. I have tried working with this code.
lijst = input('Give a list: ')
teller = 0
for i in lijst.split(','):
if lijst.count(i) != 1:
teller += 1
print(teller != 0)
Normally I should get False, since there are no double numbers in the given list. However, I recieve True. I suggest that's because the 2 appears also in 20.
True
Does anyone know how to avoid this problem, so the the '2' isn't counted twice?