I don't understand why with the code:

   for k in range(8,12,1):
     print(k.to_bytes(2,byteorder='big'))

one gets the following output:

   b'\x00\x08'
   b'\x00\t'
   b'\x00\n'
   b'\x00\x0b'

I mean the 2nd and 3rd should be b'\x00\x09' and b'x00\x0a'.
Anyway, how could I get the output in the forms I want?

Thanks in advance.

M. K. Shen


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to