-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using docstrings and doctests #30
Labels
Comments
dpshelio
added
week06
Documenting projects and findging bugs
preparation
Exercises to do before the class
labels
Nov 3, 2022
Should be #30 not UCL-COMP0233-21-22/RSE-Classwork#30 |
This was referenced Nov 21, 2022
ENTERNALSUMMER
pushed a commit
to ENTERNALSUMMER/average_squares
that referenced
this issue
Dec 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
This exercise will show why it is important to keep documentation accurate, and how to do this automatically using docstrings and doctests.
Setup
average_squares
repository. (git clone [email protected]:<your_user_name>/average_squares.git
)squares.py
fileUnderstanding
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
doctest
module to see whether the documentation of the code is accurate:python -m doctest squares.py
Update the docstrings
average_of_squares
function.average_of_squares
function that are incorrectCorrect the code and verify
doctest
to confirm that theaverage_of_squares
documentation is now correctRepeat the process for
convert_numbers
doctest
error from theconvert_numbers
documentation.Submit a Pull Request
Once you have completed or made progress on the exercises
Answers UCL-COMP0233-22-23/RSE-Classwork#30
Sample Solution: UCL-COMP0233-2022-2023/average_squares#19
The text was updated successfully, but these errors were encountered: