Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #calculates the area of a triangle.
- def triangle_area():
- # asks the user for the height and base of a triangle
- input1 = input(" height of the triangle ")
- input2 = input ("base of a triangle ")
- #and then calculates
- area =float( input1) * float(input2) /2
- #and prints out its area
- print ( "the area of a triangle is " + str(area) )
- triangle_area()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement