3 ms·
%d converts the value to int first which might be useful: >>> '%d' % 3.14 '3' >>> '%d' % 'foo' TypeError: %d format: a number is required, not
by jkbr 11y ago
%d converts the value to int first which might be useful:
>>> '%d' % 3.14
'3'
>>> '%d' % 'foo'
TypeError: %d format: a number is required, not str