Today I show all the many many ways to format strings in python as well as my recommendations on "one way to do it"!
'foo' + 123
format(21.567, '.2f')
format(21.567, '.1f')
bar = (1,)
'foo %r' % bar
'foo %r' % (bar,)
python t.py
Today I show all the many many ways to format strings in python as well as my recommendations on "one way to do it"!
'foo' + 123
format(21.567, '.2f')
format(21.567, '.1f')
bar = (1,)
'foo %r' % bar
'foo %r' % (bar,)
python t.py