Ski jumpers
Task
The program evaluates ski jumps. It reads the number of jumpers (1 to 20), generates their jumps as random decimal numbers from 75 to 100 metres rounded to one decimal place, makes a "presentation of the jumps" and finds the longest jump.
Split it into functions the tests call directly:
vygeneruj_skoky(pocet)returns a list ofpocetrandom lengths from 75 to 100 rounded to 1 decimal place,najdlhsi_skok(skoky)returns the position (from 1) of the jumper with the longest jump; if there are several, the first one,prezentacia(skoky)prints a line like1. skokan: 87.5 mfor every jumper (the length always with one decimal place).
What the program should do
najdlhsi_skok([88.5, 97.0, 91.2]) returns 2.
Examples
Call
print(najdlhsi_skok([88.5, 97.0, 91.2]))
Expected output
2
Call
prezentacia([88.5, 97.0])
Expected output
1. skokan: 88.5 m 2. skokan: 97.0 m
Call
s = vygeneruj_skoky(20) print(len(s) == 20, all(75 <= x <= 100 for x in s), all(round(x, 1) == x for x in s)) print(len(set(vygeneruj_skoky(20))) > 1)
Expected output
True True True True
After you submit, 5 hidden tests will also check your solution: two equally long jumps, one jumper, the longest comes last, the number of jumps, a length given as a whole number.
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.