Write a programElementary20 XPExercise 5/6

A safe average

Task

The program reads lines until the word koniec (end) arrives. Every line that is a number (decimals too, with a dot) is counted. For a line that is not a number it prints preskakujem: (skipping) followed by that line.

At the end it prints priemer: (average) and the average of the counted numbers to 2 decimal places, or ziadne cisla (no numbers) if there were none.

Examples

  • Input

    4
    5.5
    ahoj
    10
    koniec

    Expected output

    preskakujem: ahoj
    priemer: 6.50

Rules

  • Handle the input with try / except.

  • The except branch is missing.

After you submit, 4 hidden tests will also check your solution: the end at once, a negative number, only invalid lines, a decimal comma.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.