Advertisement
qwerty199991

жребий Крижановского

May 27th, 2022
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. from collections import Counter
  2. variants = [int(input(f'Введите вариант участника {x+1}: ')) for x in range(int(input('Введите число участников: ')))]
  3. quantity = dict(Counter(variants))
  4. compare = 0
  5. for x,y in quantity.items():
  6.     if y == 1:
  7.         if not compare:
  8.             compare = x
  9.         if x < compare:
  10.             compare = x
  11.            
  12. if compare:
  13.     print(f'Победитель - участник номер {variants.index(compare)+1}')
  14. else:
  15.     print('Победителя нет')
  16. print(compare)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement