Created
August 9, 2022 15:10
-
-
Save rubycarefree/2a92bb1261fdac5bd7f4df57ec7af7d5 to your computer and use it in GitHub Desktop.
This function to calculate the area of a rectangle is not very readable. Can you refactor it, and then call the function to calculate the area with base of 5 and height of 6? Tip: a function that calculates the area of a rectangle should probably be called rectangle_area, and if it's receiving base and height, that's what the parameters should b…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rectangle_area(base, height): | |
area = base * height | |
print("The area is " + str(area)) | |
rectangle_area(5,6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment