In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sides. Write a program that prompts the user to enter the length of the three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle. Use functional programming paradigm on this problem.
def is_right(opp, adj, hyp):
opp = int(input(''))
adj = int(input(''))
hyp = int(input(''))
if hyp**2 == opp ** 2 + adj ** 2:
return 'This is a right angle triangle'
else:
return 'This is not a right angle triangle'
Comments
Leave a comment