#!/usr/bin/env python3; ############################################################################### # This program checks a traingle to see if it is a right triangle. # # Copyright © 2020 Richard Lesh. All rights reserved. ############################################################################### import Utils # Begin Main HYPOTENUSE_STR = Utils.prompt("Hypotenuse: ") LEG1_STR = Utils.prompt("Leg #1: ") LEG2_STR = Utils.prompt("Leg #2: ") HYPOTENUSE = Utils.stodWithDefault(HYPOTENUSE_STR, 0.) LEG1 = Utils.stodWithDefault(LEG1_STR, 0.) LEG2 = Utils.stodWithDefault(LEG2_STR, 0.) IS_RIGHT_TRIANGLE = HYPOTENUSE * HYPOTENUSE == LEG1 * LEG1 + LEG2 * LEG2 print("Triangle is " + ("" if IS_RIGHT_TRIANGLE else "NOT ") + "a right triangle!")