dabeaz-course/practical-python

Small format issue in chapter 2.3

Closed this issue · 0 comments

Under the format() method part there are two examples of how format() can be used and the last one has a typo in it - the first item of the format string loses its right alignment symbol
How it looks now:

>>> '{:10s} {:10d} {:10.2f}'.format('IBM', 100, 91.1)
'       IBM        100      91.10'

How it should look like:

>>> '{:>10s} {:10d} {:10.2f}'.format('IBM', 100, 91.1)
'       IBM        100      91.10'