# File: hypot.py # compute the hypotenuse of a right triangle # # ** this does no error checking ** # # Matt Bishop, MHI 289I, Winter 2018 # # bring in the square root function from math import sqrt # # read in the length of the two sides, as floats # note we handle non-numbers as an exception here! # x = float(raw_input("First side: ")) y = float(raw_input("Second side: ")) # looking good . . . do the computation z = sqrt(x ** 2 + y ** 2) print "A right triange with sides", x, "and", y, "has a hypotenuse of length", z