Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- Programa que convierte de ºC -> ºF o de ºF -> ºC
- Conversion
- ºF = 1.8 * ºC + 32
- ºC = (ºF - 32) / 1.8
- 10ºC equivalen a 50ºF
- """
- print("Menu de opciones:")
- print("-----------------")
- print("1. Convertir de ºC a ºF")
- print("2. Convertir de ºF a ºC")
- opcion = input("Ingrese su opcion: ")
- temperatura = float(input("Ingrese la temperatura: "))
- if opcion == "1":
- temperatura = 1.8 * temperatura + 32
- print(f"Temperatura: {temperatura}ºF")
- elif opcion == "2":
- temperatura = (temperatura - 32) / 1.8
- print(f"Temperatura: {temperatura}ºC")
- else:
- print("Opción incorrecta")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement