"dcrespo" <dcrespo at gmail.com> writes: > >>>hex(255)[2:] > 'ff' '%x'%255 is preferable since the format of hex() output can vary. Try hex(33**33).