Advertisement
scipiguy

Python 102: My Function

Apr 22nd, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. # Futurelearn RPi course: Python 102 - Week 1 Function
  2.  
  3. def tri_area():
  4.     height = int(input("What is the height of the triangle> "))
  5.     width = int(input("What is the width of the triangle> "))
  6.     area = 0.5 * width * height
  7.     print("The area of your triangle is " + str(area))
  8.    
  9. tri_area()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement