SHARE
TWEET

Triangle area

Grafundzijus Apr 22nd, 2019 (edited) 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Create a function that asks the user for the height and base of a triangle,
  2. # and then calculates and prints out its area.
  3.  
  4. triangle_height = float(input('height = '))
  5. triangle_base = float(input('base = '))
  6.  
  7. def triangle_area(triangle_height, triangle_base):
  8.     return triangle_height * triangle_base / 2
  9.    
  10. print(triangle_area(triangle_height, triangle_base))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top