crzcas

area_of_triangle

Nov 12th, 2020 (edited)
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def area_of_triangle():
  2.     input1=input("Type the height >")
  3.     input2=input("Type the base >")
  4.     h=int(input1)
  5.     b=int(input2)
  6.     area=(b*h)/2
  7.     print("The area of the triangle is "+str(area))   #print area like string
  8.  
  9.  
  10. area_of_triangle()    #run the function
Advertisement
Add Comment
Please, Sign In to add comment