Review the following code:
What is the output?
Review the following code:
What is the output?
The code uses the struct module to unpack a binary string. The given string '\x01\x00' represents a 2-byte value. The '<H' format string specifies little-endian order with an unsigned short (2 bytes). In little-endian byte order, the least significant byte comes first. Therefore, '\x01\x00' is read as 0x0001, which is equal to the integer value 1. The unpack function returns a tuple with one element, which is (1,).
>>> a = "\x01\x00" >>> struct.unpack("<H",a) (1,) >>>
that answer is B