Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created May 18, 2018 12:41
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 Fhernd/211dc100b019233d4062b9fe619eee69 to your computer and use it in GitHub Desktop.
Save Fhernd/211dc100b019233d4062b9fe619eee69 to your computer and use it in GitHub Desktop.
Representar valores enteros como binarios, octales o hexadecimales. OrtizOL.
numero = 9876
print(bin(numero))
print(oct(numero))
print(hex(numero))
print('')
print(format(numero, 'b'))
print(format(numero, 'o'))
print(format(numero, 'x'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment