Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # Script que pide una temperatura y la convierte
- print("Programa de conversión de temperaturas")
- print("======================================")
- while True:
- print("""\nMenu de conversión
- ------------------
- 1. ºC a ºF
- 2. ºF a ºC
- 3. Salir
- ------------------""")
- opcion = input("Seleccione una opción: ")
- if opcion == "1":
- temp = int(input("Ingrese la temperatura: "))
- print(f"{temp}ºC equivalen a {temp*1.8 + 32}ºF")
- elif opcion == "2":
- temp = int(input("Ingrese la temperatura: "))
- print(f"{temp}ºF equivalen a {(temp-32)/1.8}ºC")
- elif opcion == "3":
- print("Gracias por usar este programa....")
- break
- else:
- print("Opciòn incorrecta")
Advertisement
Advertisement
Advertisement
RAW Paste Data
Copied
Advertisement