Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. with open ('C:/Users/nagibatorpwnz/Desktop/dataset_3363_3.txt','r') as inf:
  2.     s2=inf.read().strip().lower()
  3. s=[str(i) for i in s2.split()]
  4. count=0
  5. c=0
  6. for i in s:
  7.     if s.count(i)>=count:
  8.         count=s.count(i)
  9.         c=i
  10. with open ('C:/Users/nagibatorpwnz/Desktop/output.txt','w') as out:
  11.     out.write(c)
  12.     out.write(" ")
  13.     out.write(str(count))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement