Skip to content

Instantly share code, notes, and snippets.

@Hafpaf
Last active May 2, 2019 18:48
Show Gist options
  • Save Hafpaf/ca294f8d1d102c54f1d083a2cda73c3a to your computer and use it in GitHub Desktop.
Save Hafpaf/ca294f8d1d102c54f1d083a2cda73c3a to your computer and use it in GitHub Desktop.
Convert decimal to biniary, octal, hexadecimal and charc.
'''
for i in range(16):
print(i, bin(i), oct(i), hex(i))
'''
def hexthingy(bin_c, oct_c, hex_c, chr_c):
for i in range(1):
print(i, bin(bin_c), oct(oct_c), hex(hex_c), chr(chr_c))
#convert decimal to biniary, octal, hexadecimal and charc.
hexthingy(31, 63, 127, 255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment