Practice #21: Program to Validate and Calculate Area of a Triangle | Python Coding for Beginners

preview_player
Показать описание
Description
In this exercise, you'll write a program that takes user input as 3 side lengths of a triangle.
The program then validates if the triangle is valid or not.
If valid, output the triangle area (using Heron formula)
-------------------------
Python Coding for Beginners
Python Programming for Beginners
Learn Python by Building Projects
Python Exercises and Practical Examples with solutions
Practice Python Online with solution
How to write a Python program
Рекомендации по теме
Комментарии
Автор

In this exercise we use the Heron formula to calculate area of a triangle: S = sqrt(p * (p-a) * (p-b) * (p-c)) where p = semi-perimeter. Don't forget to check the validity of triangle before calculating the area

makeeverydayezday
Автор

I very much appreciate your tutorial. I can easily understand Python concepts you cover in this video and apply them in my practice. Thanks so much!

paulshirley
Автор

Look like I need to go back to high school 😀. I almost forgot all the basic geometry formula. You helped me a lot mate. Cheers!!!

tsudashiro
Автор

Thanks for sharing, I didn't know that, to be valid, the triangle lengths must satisfy that condition. Love your videos!

JamesAdams-wczl
Автор

Well, i didn't know the formula that you can calculate area from 3 side lengths. I only know the formula S = 1/2 x (A x H). Great tips, thank you.

mukjunghee
join shbcf.ru