Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dict = {}
- listd = []
- text = open("ajto.txt","r")
- for line in text:
- line = line.strip().split(" ")
- listd.append(line[2])
- dict.update({line[2] : listd.count(line[2])})
- file = open("athaladas.txt","w")
- for k, v in sorted(dict.items()):
- file.write('{} {}\n'.format(k, v))
- text.close()
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement