17 lines
239 B
Python
17 lines
239 B
Python
somma = 0
|
|
conto = 0
|
|
|
|
while True:
|
|
uinput = float(input("Voto da inserire: "))
|
|
|
|
if uinput == -1:
|
|
break
|
|
|
|
if uinput <= 20:
|
|
somma += uinput
|
|
conto += 1
|
|
|
|
|
|
if conto != 0:
|
|
print("La media è: ", somma/conto)
|