Computer Science, asked by chandandas07, 1 year ago

write a program in Python to find the area of equalatrail triangle​

Answers

Answered by AskewTronics
0

Below are the Output and the python program for the question above :

Output :

If the user input as 3, then the output is : 3.8971143170299736

If the user input as 1, then the output is : 0.4330127018922193

Explanation:

from math import sqrt #package for the sqrt function.

side = float(input("Enter side to find the area :" ))#take the input from the user.

print("The area is = : ",(sqrt(3)/4)*(side**2)) #print the area.

Code Explanation:

The above code is in python language, which takes the input from the user and then saves it in side variable after converting it into the float.

Then the formula of the equilateral triangle is used to find the area of a triangle and print the area with the help of print function.

Learn More :

  • Python :  brainly.in/question/14689905

Answered by Equestriadash
8

The following codes must be typed in script mode, saved and then executed.

CODE 1:

s = float(input("Enter the length of the side of the triangle:"))

area = ((3)**(1/3)*(s**2))/4

print("The area of the triangle is", area)

OUTPUT:

\tt Enter\ the\ length\ of\ the\ side\ of\ the\ triangle: 3

\tt The\ area\ of\ the\ triangle\ is\ 3.9

CODE 2:

s = float(input("Enter the length of the side of the triangle:"))

print("The area of the triangle is", ((3)**(1/3)*(s**2))/4)

OUTPUT:

\tt Enter\ the\ length\ of\ the\ side\ of\ the\ triangle: 3

\tt The\ area\ of\ the\ triangle\ is\ 3.9

Similar questions