Space Python Loading Python…

Documenting Functions

 
0:00 / 0:00

Challenge

Practise what this example shows: fix or write code until the tests pass.

Docstring and type hints

Write the codeEasy 2 stages

Add a docstring to fuel_needed() that says what it returns and what the reserve means, then add type hints for its parameters and return value; the tests read both from the function itself.

Start the challenge

Discussion

Stuck on this example or want to go further? Ask here, or see what others asked.

Log in to ask and reply.

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].