Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 14, 2021 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/bf657f9764a1286a9c7542221213f0c5 to your computer and use it in GitHub Desktop.
Save parzibyte/bf657f9764a1286a9c7542221213f0c5 to your computer and use it in GitHub Desktop.
"""
https://parzibyte.me/blog
"""
def fahrenheit_a_celsius(f):
return (f - 32) / 1.8
def celsius_a_fahrenheit(c):
return (c * 1.8) + 32
# Modo de uso
f = float(input("Ingresa los grados Fahrenheit: "))
c = fahrenheit_a_celsius(f)
print(f"Los {f} grados Fahrenheit son {c} grados celsius")
c = float(input("Ingresa los grados Celsius: "))
f = celsius_a_fahrenheit(c)
print(f"Los {c} grados Celsius son {f} grados Fahrenheit")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment