osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

{:2X} didn't output what I expected


D:\Temp>py
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> '{:02X}'.format(256)
'100'
>>>
What I expected is '00'. Am I wrong?

Best Regards,
Jach Fong