5.3 String Formatting
Q1: I know what is %e, %f, but I really can not understand %g, especially when the book interprets it as “Floating-point e or f”. What is 'or'? How does computer determine it is e or f?
Q2: I don't know what is “left justification (-)”, of course it is not a numeric sign!
Q3: I can't understand the width in formatting and the zero padding! For example:
>>> x = 1.23456789
>>> '%-6.2f | %05.2f | %+06.1f' % (x, x, x)
'1.23 | 01.23 | +001.2'
Of course the precision means the width after the decimal point, but what the width before it?
Maybe I can ask them in the google group!