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