Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=0
- b=0
- c=0
- with open("input.txt") as f:
- words = f.readlines()
- words = [x.strip() for x in words]
- for word in words:
- import collections
- letters = collections.Counter(words[c])
- if 2 in letters.values():
- a += 1
- if 3 in letters.values():
- b += 1
- c=c+1
- print (a)
- print (b)
Add Comment
Please, Sign In to add comment