Source Code:
(back to article)
num = 42 # Convert to binary num_str = "{:b}".format(num) print(num_str) # Convert to hexadecimal num_str = "{:x}".format(num) print(num_str)
Result:
Report an issue