If I use a function int.from_bytes() to convert a byte which is in a hexadecimal form it gives me a expected ans. But when the byte is in decimal form I get a unexpected value. I am not able to understand the math behind it, please explain. I am new to this my question may be silly, please try to understand from the example code below.
>>> testBytes = b'\x10'
>>> int.from_bytes(testBytes, byteorder='big', signed=True)
16
>>>testBytes1 = b'10'
>>>int.from_bytes(testBytes1, byteorder='big', signed=True)
12592
Here in the testBytes1 variable expected answer was 10, why I am getting such a big value, how does this function work, how will I get testBytes1 value as integer 10 as it is in the byte form. I am receiving testBytes1 over a usb port.