forced spaces when inserting a variable between strings

snoe case.nelson at gmail.com
Tue Jan 17 17:07:46 CET 2006


You can use:

print "<img src=%s.jpg>" % (number)
or
print "<img src="+str(number)+".jpg>"

or a number of others, but for short strings one of these two generally
work fine.




More information about the Python-list mailing list