fork download
  1. import collections
  2.  
  3. with open("newsafr.txt", "r", encoding= "utf-8") as f:
  4. array = [line.strip().split() for line in f]
  5. p = collections.Counter()
  6. data = []
  7. print(len(array))
  8. for i,j in range(len(array)):
  9. if len(array[i][j]) > 6:
  10. data.append((array[i]))
  11. for j in range(len(data)):
  12. p[data[0][j]] += 1
  13. print(data)
  14. print(p)
  15.  
Runtime error #stdin #stdout #stderr 0.02s 27712KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 3, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'newsafr.txt'