Write a programExercise 1/4Basic10 XP
Functions for a rectangle
Task
Write two functions:
obvod_obdlznika(a, b)returns the perimeter of a rectangle with sidesaandb,obsah_obdlznika(a, b)returns its area.
The functions must return the result with return, not print it. The tests call them with various sides.
Examples
Call
print(obvod_obdlznika(7, 4), obsah_obdlznika(7, 4))
Expected output
22 28
After you submit, 4 hidden tests will also check your solution: a 1 × 1 square, a decimal side, a zero side, the result is returned, not printed.
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.