Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- variants = [int(input(f'Введите вариант участника {x+1}: ')) for x in range(int(input('Введите число участников: ')))]
- quantity = dict(Counter(variants))
- compare = 0
- for x,y in quantity.items():
- if y == 1:
- if not compare:
- compare = x
- if x < compare:
- compare = x
- if compare:
- print(f'Победитель - участник номер {variants.index(compare)+1}')
- else:
- print('Победителя нет')
- print(compare)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement