fork download
  1. suma = 0
  2. ilosc = 0
  3.  
  4. while True:
  5. try:
  6. x = float(input())
  7. suma += x
  8. ilosc += 1
  9. except EOFError:
  10. break
  11.  
  12. if ilosc > 0:
  13. print(suma / ilosc)
  14. else:
  15. print("Brak danych")
Success #stdin #stdout 0.06s 14164KB
stdin
Standard input is empty
stdout
Brak danych