Advertisement
Antypas

Function area of triangle

Apr 10th, 2020
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #Create a function that accepts the dimensions of a triangle
  2. #and returns its area.
  3. def area_triangle(base, height):
  4.     area=base*height/2
  5.    
  6.     return area
  7.    
  8. myTriangleArea = area_triangle(4,3)
  9. print(myTriangleArea)
  10. print("the area of my triangle is: ", area_triangle(4,3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement