"Derek Basch" <dbasch at yahoo.com> writes: > Ahh yes you have to put parenthases around the string formatting to > remove the integer using indexes. Thanks, that's just what I needed! I think it's better to remove leading zeros explicitly: ('%.3x' % x).lstrip('0')