Hexadecimal value assignment
To assign value in hexadecimal format to a variable, we use 0x or 0X suffix. It tells to the compiler that the value (suffixed with 0x or 0X) is a hexadecimal value and assigns it to the variable.
Syntax to assign an hexadecimal value to the variable
x = 0x123AF
y = 0X1FADCB
Python code to create variable by assigning hexadecimal value
In this program, we are declaring some of the variables by assigning the values in hexadecimal format, printing their types, values in decimal format and hexadecimal format.
Output
need an explanation for this answer? contact us directly to get an explanation for this answer