In this problem, we are going to check if a triangle is a right triangle. Write a program that 1. Asks the length of the three sides 2. Lists the three sides in order 3. Outputs true if the triangle is a right triangle, outputs false otherwise. c

Answer :

MrRoyal

Answer:

Written in Python:

#1

print("Enter the three sides of the triangle: ")

a = []

for i in range(1,4):

    b = int(input())

    a.append(b)

#2

a.sort()

print(a)

#3

if a[2] ** 2 == a[0]**2 + a[1]**2:

    print("True")

else:

    print("False")

Explanation:

I've added the full program as an attachment where I used comments to explain difficult lines

${teks-lihat-gambar} MrRoyal

Other Questions