Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Create a function that asks the user for the height and base of a triangle,
- and then calculates and prints out its area.
- '''
- def tri_area():
- height=input('Enter the height of the triangle: ')
- base=input('Enter the base of the triangle: ')
- area=(int(height)*int(base))/2
- print('Triangle Area=', area, 'm^2')
- tri_area()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement