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.
- triangle_height = float(input('height = '))
- triangle_base = float(input('base = '))
- def triangle_area(triangle_height, triangle_base):
- return triangle_height * triangle_base / 2
- print(triangle_area(triangle_height, triangle_base))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement