AlexG2230954

Untitled

Jun 5th, 2022 (edited)
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. from collections import Counter
  2.  
  3.  
  4. def read_companies(file):
  5.     with open(file) as f:
  6.         data = f.read()
  7.     return data.strip().split()
  8.  
  9. files = ["ilon.txt", "bill.txt", "sasha.txt"]
  10. all_companies = Counter(sum(map(read_companies, files)))
  11.  
  12. print(len([company for company, count in all_companies.most_common() if count >= 2]))
Add Comment
Please, Sign In to add comment