How can I compare a int number with hexadecimal and binary number?
Is there any other methods available other than I found below:
if b'\xFF'[0] == 255:
print("yes")
if bin(b'\xFF') == bin(255)
print("yes")
Above is doing some sort of calls and conversions. I would be surprised that if it is not possible to define a number with any input format(binary, hex, decimal) and that is still the same number for the compiler.
Almost any compiler, I know so far, can represent a number with different notations, but no way in Python, like this one:
if 255 == 0xFF
print("yes")
if 255 == 0xFFcomparison to work in Python?"