python - string formatting -
I can not find why the colon was released for the second time
& gt; & Gt; & Gt; Print '% 5s'% ':': & gt; & Gt; & Gt; Print '% 5s'% ':' '% 2s'% ':' :: Help me with this
In Python, seismost strings are added:
& gt; & Gt; & Gt; T = 'A' 'BCD' & gt; & Gt; & Gt; T 'ABCD' In its second example, it is equivalent:
gt; & Gt; & Gt; According to the preference rules for the% operator of Python, this is: '% 5' '%':% 2s'% ':'
& Gt; & Gt; & Gt; Print ('% 5s'% ':% 2s')% ':'
or
& gt; & Gt; & Gt; Print ':% 2s'% ':' ::
Comments
Post a Comment