Advertisement
kenadams53

Area of Triangle using Python

Jul 31st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. print("We will calculate the area of a triangle")
  2. base = input("How long is the base in cm?> ")
  3. base=float(base)
  4. height = input("What is the height in cm?> ")
  5. height = float(height)
  6. area = 0.5*(base*height)
  7. print("The base is " + str(base)+ " and the height is " + str(height) + ", so the area is " + str(area))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement