
String Formatting with Python - brendanmcd
https://kite.com/blog/python/python-string-formatting
======
wodenokoto
What do the letters used to indicate formatting stand for?

I mean, %s for string and %f for float, but how is %d an integer?

~~~
naniwaduni
I've always heard it explained as "decimal", but in any case %i is also
accepted for integers.

edit: it's not clear that this is true in python, which I missed (although
experimentally it works), but it is true in at least C89, where %d and %i are
equivalent for output formats, and in input formats are distinguished by %d
accepting only decimal digits numbers, while %i interprets octal and hex (0-,
0x-) numbers as strtol would.

