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. for i in range(len(array)):
  8. for j in range(len(array[i])):
  9. if len(array[i][j]) > 6:
  10. data.append(array[i][j])
  11. for word in data:
  12. p[data] += 1
  13.  
  14.  
  15.  
  16. print(data)
  17. print(p)
  18.  
  19.  
  20. #Ошибка TypeError: unhashable type: 'list'
Runtime error #stdin #stdout #stderr 0.02s 28384KB
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'