Rainfall Problem

Aus ProgrammingWiki

Wiki-Quelltext dieser Seite.

<language>Python</language>
Das Problem:

<pre>
Read in integers that represent daily rainfall, and print out the average daily rainfall. If the input value of rainfall is less than zero, prompt the user for a new rainfall. When you read in 99999, print out the average of the positive integers that were input other than 99999.
</pre>

Schreibe ein Programm in Python, welches die obige Aufgabenstellung erfüllt:

<run id="5dd156b4a8d97">
i = int(input('Gib eine Zahl ein:'))

print (i)
</run>