Python program to Calculate the Area and Perimeter of Right-Angle Triangle

import math
x = float(input("Insert length of x: "))
y = float(input("Insert length of y: "))
z = math.sqrt((pow(x,2)+pow(y,2)))
Area = (x*y)/2
Perimeter = x+y+z
print("Area of right angled triangle = %.2f" % Area)
print("Perimeter of right angled triangle = %.2f" % Perimeter)

 

 

 

Output:

Insert length of x: 22
Insert length of y: 12
Area of right angled triangle = 132.00
Perimeter of right angled triangle = 59.06

 

Subscribe For Daily Updates