Advertisement
maxim_shlyahtin

Task_2

Oct 17th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from collections import Counter
  2.  
  3. s1 = []
  4. s = list(input().lower().split())
  5. for i in range(len(s)):
  6. s[i] = list(s[i])
  7. for j in range(len(s[i])):
  8. if s[i][j].isalpha() == False:
  9. s[i][j] = s[i][j].replace(s[i][j], '')
  10. s[i] = ''.join(s[i])
  11. c = Counter(s)
  12. c = dict(c.most_common(2))
  13. for k in c.keys():
  14. s1.append(k)
  15. print(s1[1])
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement