Materials and IPython notebooks for "Python for Data Analysis" by Wes McKinney, published by O'Reilly Media
22.27k
stars
15.19k
forks
source link
In chapter 2, print(template) is not giving expected answer as the original string never get changed by this format #183
Closed
AnCyNitinChaudhary closed 1 year ago
Your Code: template="{0:.2f} {1:s}are worth US${2:d}" template.format(4.5667,'Argentine Pesos',1) print(template)
Output Your Code: {0:.2f} {1:s}are worth US${2:d}
Updated Code: template="{0:.2f} {1:s}are worth US${2:d}".format(4.5667,'Argentine Pesos',1) print(template)
Output Updated Code: 4.57 Argentine Pesosare worth US$1