About to_bytes() method of int type
About to_bytes() method of int type Question: I have a question about to_bytes method of int type in Python. Say, a = 100. Why is a.to_bytes(2, "big") not b"x00x64" but b"x00d"? Seems to me that b"x00d" is not even 2 bytes. Asked By: agongji || Source Answers: b"x00d" means 2 bytes: x00 and d but …