Tom_Jung

Untitled

Feb 14th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ## A Python program for calculating a triangle area with input from the user.
  2. base = float(input("Enter the base: "))
  3. height = float(input("Enter the height: "))
  4. units = str(input("Enter base & height units cm or m or ft: "))
  5.  
  6. def triangle_area(base,height):
  7.  
  8. area = 0.5 * base * height
  9.  
  10. return area
  11.  
  12. print("The triangle area is: ", triangle_area(base,height))
  13. print("The units of the dimensions are square: ", units)
Advertisement
Add Comment
Please, Sign In to add comment