UCL-COMP0233-24-25 / RSE-Classwork

6 stars 86 forks source link

Using docstrings and doctests #19

Open dpshelio opened 3 weeks ago

dpshelio commented 3 weeks ago

This exercise will show why it is important to keep documentation accurate, and how to do this automatically using docstrings and doctests.

Setup

Understanding

Exercises

As you may have discovered, the code in squares.py does contain some mistakes. Thankfully the functions in the file include documentation that explains how they should behave.

Run the doctests

Update the docstrings

Correct the code and verify

Repeat the process for convert_numbers

Submit a Pull Request

Once you have completed or made progress on the exercises


Sample solution on the doctest branch.