Question

Assignment: using the handout as an example write a Python program that computes the area of a triangle from Herons formula Formulation Herons formula states that the area of a trangle whose sices have lengtns a, b andes where s is the semipernmeter of the trianglethat s Herons formula can also be written as Astra + b + ex-a + b + e)(a-b+c)(a + b-c) Example la et &.ABC te the trangle with sies a-4b-13 ande-15. Thespnts -13+15)-16.an he are Vc--b-o)-Vi(Ie-4-(0-13)(0-1)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

I have written a python code for calculating area of a triangle using Heron's formula. Hope it helps you. Cheers :)

Code:

a = float(input(Please enter first side of t b -float(input( Please enter second side of triangle: )) #Taking input for second side c -float(input (Please enter third side of triangle: )) #Taking input for third side riangle: )) #Taking input for first side 2 3 4. 5 6 7 8 9 s (a-b-c)/2# Calculating semi-perimeter area: (s(sa)*(sb)(s-c))**0.5 #Calculating area print(Area of triangle : %f%area) # Printing area

Output:

Add a comment
Know the answer?
Add Answer to:
Assignment: using the handout as an example write a Python program that computes the area of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT