crzcas

area_of_triangle

Jan 3rd, 2021
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. # Calculating area of triangle giving base and height
  2. def triangle_area(base, height):
  3.    area = (float(base) * float(height))/2
  4.    return area
  5.  
  6. base = input("Type the base > ")
  7. height = input("Type the height > ")
  8.  
  9. my_area = triangle_area(base,height)
  10.  
  11. print("Area of Triangle = " + str(my_area))
Advertisement
Add Comment
Please, Sign In to add comment