Guest User

Untitled

a guest
Dec 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. a=0
  2. b=0
  3. c=0
  4. with open("input.txt") as f:
  5. words = f.readlines()
  6. words = [x.strip() for x in words]
  7.  
  8. for word in words:
  9. import collections
  10. letters = collections.Counter(words[c])
  11. if 2 in letters.values():
  12. a += 1
  13. if 3 in letters.values():
  14. b += 1
  15. c=c+1
  16.  
  17. print (a)
  18. print (b)
Add Comment
Please, Sign In to add comment