Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. text = open('input.txt')
  2. lines = text.readlines()
  3. symbols = str.maketrans('', '', '!@#$%^&*()}{]{,.?:;')
  4. dict = {}
  5. ofof = list()
  6. p = list()
  7. t = 0
  8. for line in lines:
  9.     k = line.translate(symbols).split()
  10.     ofof.extend(k)
  11. for i in ofof:
  12.     dict[i] = dict.get(i, 0) + 1
  13.     p.append(dict[i]-1)
  14. print(*p)
  15. text.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement