Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def area(): #calculate the area of a triangle
- print("Let's caclulate the area of a triangle")
- base = input("What length is the base of the triangle? ")
- height = input("What is the height perpendicular to the base? ")
- b = float(base)
- h = float(height)
- area = b * h /2
- output = str(area)
- print("Area of a triangle with base "+base+" and height "+height+" = "+output)
- area()
Advertisement
Add Comment
Please, Sign In to add comment