The hypotenuse of a triangle
Task
The program reads the legs of a right triangle (decimal numbers, each on its own line) and prints the length of the hypotenuse rounded with round to 2 decimal places. Calculate the square root with sqrt from the math module.
For legs 3 and 4 the program prints 5.0.
Examples
Input
3 4
Expected output
5.0
Rules
Import the
mathmodule.
After you submit, 5 hidden tests will also check your solution: legs 5 and 12, legs 1 and 1, a decimal leg, small numbers, very different legs.
You need to know
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.