2 ms·
Once you start formatting more than one variable, isn't your proposed syntax going to be horribly long? '{:center :minsize=8 varname} {:center :minsize=8 v
by roywiggins 12y ago
Once you start formatting more than one variable, isn't your proposed syntax going to be horribly long?
'{:center :minsize=8 varname} {:center :minsize=8 varname2} {:center :minsize=8 varname2}'.format(varname=123, varname2=123,varname3=123)
instead of
'{:^8} {:^8} {:^8}'.format(varname, varname2, varname3)
Concision is not always a good thing, but still...
- gcb0 12y agotop one is still much more readable. also, if you are going to repeat always the same, you can standardize it in a string var and just use that instead of repeating. and if you are NOT, then it beats '{:^8} {:*8} {:@8} {:☃8}' anytime, because now you have to know and notice the change in those cryptic chars.