Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- def read_companies(file):
- with open(file) as f:
- data = f.read()
- return data.strip().split()
- files = ["ilon.txt", "bill.txt", "sasha.txt"]
- all_companies = Counter(sum(map(read_companies, files)))
- print(len([company for company, count in all_companies.most_common() if count >= 2]))
Add Comment
Please, Sign In to add comment