Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 15, 2020 05:11
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/cb7389fba912e3d133f6a79fdbe76ed2 to your computer and use it in GitHub Desktop.
Save parzibyte/cb7389fba912e3d133f6a79fdbe76ed2 to your computer and use it in GitHub Desktop.
def convertir(numero, base_destino):
if base_destino == "2":
return conversiones.decimal_a_binario(numero)
elif base_destino == "8":
return conversiones.decimal_a_octal(numero)
elif base_destino == "10":
return int(numero)
elif base_destino == "16":
return conversiones.decimal_a_hexadecimal(numero)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment