Answers for "hexadecimal with python"

0

hexadecimal with python

# int into hex
_hex = hex(42) # hexadecimal string

# hex into int
# you must specify base 16 as 2nd param as this tells python you're
# working with hexadecimal
int_hex = int(_hex, 16) # returns an integer
Posted by: Guest on March-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language