Skip to content

Commit

Permalink
Merge pull request #830 from flappybird-code/patch-2
Browse files Browse the repository at this point in the history
Updated areaoftriangle.py
  • Loading branch information
tarunsinghofficial committed Oct 29, 2020
2 parents e31144a + 142b967 commit 0b32fcf
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions Python-programming-1/areatriangle.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Python Program to find the area of triangle

a = 5
b = 6
c = 7

# Uncomment below to take inputs from the user
# a = float(input('Enter first side: '))
# b = float(input('Enter second side: '))
# c = float(input('Enter third side: '))

# calculate the semi-perimeter
a = float(input("Enter first side:"))
b = float(input("Enter second side:"))
c = float(input("Enter third side:"))
s = (a + b + c) / 2

# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('The area of the triangle is %0.2f' %area)
print("Area of triangle is :",area)

0 comments on commit 0b32fcf

Please sign in to comment.