fork(1) download
  1. file = open('a.txt', 'r')
  2.  
  3. total = ave = cnt = 0
  4.  
  5. for i in file:
  6. for j in i.split(","):
  7. total += int(j.rstrip())
  8. cnt += 1
  9.  
  10. print("合計:" + str(total))
  11. print("平均:" + str(total / cnt))
Runtime error #stdin #stdout #stderr 0.01s 28384KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'a.txt'