Created
January 31, 2016 09:39
-
-
Save jerryalfs/f922afb42945d1c5f320 to your computer and use it in GitHub Desktop.
Calculate Area Of Trapezoid With Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Area Of A Trapezoid | |
h = input("Enter the height of the trapezoid : ") | |
#input value height of the trapezoid | |
h = float(h) | |
#convert h into float value | |
lb = input("Enter the lenght of the bottom base : ") | |
#input value lenght bottom base | |
lb = float(lb) | |
#convert lenght bottom base to float value | |
lt = input("Enter the lenght of the top base : ") | |
#input value lenght top base | |
lt = float(lt) | |
#convert lenght top base to float value | |
a = 1/2 * (lb + lt) * h | |
#formula to calculate area of trapezoid | |
print ("Area of a trapezoid : ",a) | |
#print value area of a trapezoid have stored with a variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment