forced spaces when inserting a variable between strings

snoe case.nelson at gmail.com
Tue Jan 17 11:07:46 EST 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