Advertisement
GerONSo

Untitled

Oct 24th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. with open('input.txt') as f:
  2. x = f.readlines()
  3. m = {}
  4. for s in x:
  5. p = s.strip().split(',')
  6. for i in p:
  7. if(i in m):
  8. m[i] += 1
  9. else:
  10. m[i] = 1
  11. mx = 0
  12. res = ''
  13. for i in m.items():
  14. if(mx < i[1]):
  15. mx = i[1]
  16. res = i[0]
  17. print(res)
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement