given a list of numbers find and print the first number that occurs only once in the list and the first number that occurs more than once in the list
sample input 1:
5 5 4 7 4 1 11
sample output 1:
7
5
sample input 2:
1 2 3 4 5 6 7 8 9
sample output 2:
1
None
if __name__ == '__main__':
data = [int(i) for i in input().split()]
uniq_number = None
repeate_number = None
for i in data:
if data.count(i) == 1:
uniq_number = i
break
for i in data:
if data.count(i) > 1:
repeate_number = i
break
print(uniq_number)
print(repeate_number)
Comments
Leave a comment