Challenge
Docstring and type hints
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.
4 results
Challenge
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.
Example
Docstrings describe what a function does. Good programming practice.
Quiz
…def, return, arguments, default values, *args, scope and docstrings. Instant answers.
Article Python Fundamentals
…about what the rest of the program is up to. Naming and docstrings Good function names are usually verbs, or short phrases that start with one, because a function does something: calculate_fuel…