March 11, 2016
8:51 a.m.
Serhiy Storchaka added the comment: I agree with you and always prefer formatting strings. Your example shows that at least an alternative to str.zfill() should be mentioned in the educational purposes. With C-style formatting your example can be written more laconically: return "%0*x" % (length, ...) ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26506> _______________________________________