Skip to content

Commit

Permalink
Fix calculation bug in rectangle_area function
Browse files Browse the repository at this point in the history
  • Loading branch information
Envestoren committed Mar 6, 2024
1 parent 115dea4 commit 8304dd5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions area.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
def rectangle_area(length, width):
if length < 0 or width < 0:
raise ValueError('Length and width must be positive numbers')
return length + width
return length * width

def circle_area(radius):
if radius < 0:
Expand All @@ -13,4 +13,6 @@ def circle_area(radius):
def triangle_area(base, height):
if base < 0 or height < 0:
raise ValueError('Base and height must be positive numbers')
return 0.5 * base * height
return 0.5 * base * height

def

0 comments on commit 8304dd5

Please sign in to comment.