Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Programa que pide una temperatura en ºC y la convierte a ºF o viceversa
- while True:
- print("\nPrograma de conversión de temperaturas")
- print("--------------------------------------")
- print("""Menu de opciones
- 1. ºF -> ºC
- 2. ºC --> ºF
- 3. Salir
- """)
- opcion = input("Elija su opción: ")
- if opcion == "1":
- temp = float(input("Ingrese la temperatura: "))
- print(f"La temperatura equivale a {(temp-32) / 1.8}ºC")
- elif opcion == "2":
- temp = float(input("Ingrese la temperatura: "))
- print(f"La temperatura equivale a {temp * 1.8 + 32}ºF")
- elif opcion == "3":
- print("Gracias por usar este programa....")
- break
- else:
- print("Opción incorrecta ...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement