DerioFT

1117.py

Oct 26th, 2021
906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. addition = 0
  2. total = 0
  3.  
  4. while True:
  5.    
  6.     data = float(input())
  7.  
  8.     if data >= 0 and data <= 10:
  9.  
  10.         addition += data
  11.         total += 1
  12.  
  13.     else:
  14.         print("nota invalida")
  15.  
  16.     if total == 2:
  17.  
  18.         average = addition / total
  19.         print("media = %.2f" % average)
  20.         break
  21.  
Advertisement
Add Comment
Please, Sign In to add comment