Last active
May 2, 2019 18:48
-
-
Save Hafpaf/ca294f8d1d102c54f1d083a2cda73c3a to your computer and use it in GitHub Desktop.
Convert decimal to biniary, octal, hexadecimal and charc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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