-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
update variable names for consistency using standard formula terms; #2223
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
Conversation
fix flake8 syntax errors; fix doctests;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the cube and square, I think side_length
as the param is better, apart from that, good job
I used side because that is what wikipedia uses in the formula, A = s^2. Reading the article closer, s is for side length, not just side. Change is in, thanks. |
@@ -48,24 +48,24 @@ def area_square(side_length): | |||
>>> area_square(10) | |||
100 | |||
""" | |||
return side_length * side_length | |||
return pow(side_length, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds function call overhead but let's let it slide.
|
||
|
||
def area_parallelogram(base, height): | ||
""" | ||
Calculate the area of a parallelogram | ||
|
||
>> area_parallelogram(10,20) | ||
>>> area_parallelogram(10,20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -75,8 +75,8 @@ def area_trapezium(base1, base2, height): | |||
""" | |||
Calculate the area of a trapezium | |||
|
|||
>> area_trapezium(10,20,30) | |||
450 | |||
>>> area_trapezium(10,20,30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks.
…heAlgorithms#2223) * update variable names for consistency using standard formula terms; fix flake8 syntax errors; fix doctests; * tweak to variable name
fix flake8 syntax errors;
fix doctests;
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.