Skip to content

Instantly share code, notes, and snippets.

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