[Tutor] To FORMAT or not to

yehudak . katye2007 at gmail.com
Sun Jan 3 07:27:01 EST 2016


Hi there,
In a program I wrote the following line (Python 3.5):

print("You've visited", island, '&', new + ".")

A programmer told me that it's a bad habit, and I should have used instead:

print("You've visited {0} {1} {2}{3}".format(island, "&", new, "."))

May I understand why?


More information about the Tutor mailing list