Created
January 31, 2016 09:48
-
-
Save jerryalfs/7347c5b881a44ff63ea6 to your computer and use it in GitHub Desktop.
Calculate Area Equilateral Triangle With Python
This file contains 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 an equilateral triangle | |
import math | |
#to use math function must import lib math | |
h = input("Enter the height of equilateral triangle : ") | |
#to input value height and store to variable h | |
h = float(h) | |
#convert value have input to be float | |
a = (h**2 * math.sqrt(3))/3 | |
#formula to calculate the area | |
print ("The area of an equilateral triangle : ",a) | |
#print the area with called value have calculate and store at variable a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment