Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## A Python program for calculating a triangle area with input from the user.
- base = float(input("Enter the base: "))
- height = float(input("Enter the height: "))
- units = str(input("Enter base & height units cm or m or ft: "))
- def triangle_area(base,height):
- area = 0.5 * base * height
- return area
- print("The triangle area is: ", triangle_area(base,height))
- print("The units of the dimensions are square: ", units)
Advertisement
Add Comment
Please, Sign In to add comment