Menu
Icon

Ejemplo Calculando Grados Fahrenheit Python.

{En este ejemplo echo en Python utilizaremos Las Formulas de conversión de incrementos
de grados Fahrenheit para calcular el valor de temperatura Introducido.

Grados Fanherenheit

Formulas:
Fahrenheit a Celsius   C =(F-32)*5/9
Fahrenheit a Kelvin K = (F-32)*5/9 +273

Celsius a Fahrenheit  F =C*9/5+32
Celsius a Kelvin K=C+273

Kelvin a Fahrenheit   F= (k-273)9/5+32
Kelvin a Celsius C=K-273

Codigo:

print 'Grados'
accion = 0
F=0.00
C=0.00
K=0.00
while accion!=1 and accion!=2 and accion!=3 and accion!=4 and accion!=5 and accion!=6:
   print 'Seleccione la conversion que quiere haser'
   print '1. Fahrenheit a Celsius'
   print '2. Fahrenheit a Kelvin'
   print '3. Celsius a Farenheit'
   print '4. Celsius a Kelvin'
   print '5. Kelvin a Fahrenheit'
   print '6. Kelvin a Celsius'
   accion = int(raw_input('Introduzca accion:  '))
  
   
if(accion == 1):
   F = float(raw_input('Ingrese cantidad de Fahrenheit para convertir a Celsius:  '))
   C =(F-32)*5/9;
   print C

if(accion == 2):
   F = float(raw_input('Ingrese cantidad de Fahrenheit para convertir a Kelvin:  '))
   K = (F-32)*5/9+273;
   print K

if(accion == 3):
   C = float(raw_input('Ingrese cantidad de Celsius para convertir a Farenheit:  '))
   F =C*9/5+32;
   print F
   
if(accion == 4):
   C = float(raw_input('Ingrese cantidad de Celsius para convertir a Kelvin:  '))
   K=C*1+273;
   print K
   
   
if(accion == 5):
   K = float(raw_input('Ingrese cantidad de Kelvin para convertir a Fahrenheit:  '))
   F= (K-273)*9/5+32;
   print F
   
if(accion == 6):
   K = float(raw_input('Ingrese cantidad de Kelvin para convertir a Celsius:  '))
   C=K-273;
   print C," C"


Descargar Ejemplo:


}

Utilizamos cookies propias y de terceros con finalidades analiticas y para mejorar tu experiencia de compras segun tus preferencias, mediante el analisis de tus habitos de navegacion y tu perfil. Puedes aceptar todas las cookies pulsando el boton "Aceptar" o gestionar tus preferencias en el panel de configuracion