Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. '''
  2. Create a function that asks the user for the height and base of a triangle,
  3. and then calculates and prints out its area.
  4. '''
  5. def tri_area():
  6.     height=input('Enter the height of the triangle: ')
  7.     base=input('Enter the base of the triangle: ')
  8.     area=(int(height)*int(base))/2
  9.     print('Triangle Area=', area, 'm^2')
  10.    
  11. tri_area()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement