Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open(r'C:\Pyton\dataset_3363_2.txt') as inf:
- ishod=[]
- for line in inf:
- line=line.replace('\n', ' ').lower().split()
- ishod=ishod+line
- slovar={}
- for x in ishod:
- if (ishod.count(x)) in slovar:
- if (slovar[ishod.count(x)][0])<x:slovar[ishod.count(x)]=x
- continue
- slovar[(ishod.count(x))]=[x]
- print(slovar[(max(slovar.keys()))], max(slovar))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement