• Lenguaje

    Python

  • Descripción

    Se tiene un triángulo rectángulo. Obtenga e imprima la hipotenusa al recibir como datos el cateto adyacente y el ángulo en grados.

1
2
3
4
5
6
7
8
import os, math

cateto_adyacente = float (input ('Ingresa el valor de cateto adyacente: '))
grados = float (input ('Ingresa el valor de grados: '))
hipotenusa=cateto_adyacente/math.cos(grados*math.pi/180)
print ('Valor de hipotenusa: ' + repr (hipotenusa))
print ()
os.system ('pause')