Is it possible in python to print a string with variables embedded inside it. I'm new to python so I'm not even sure how you would show that some word is a variable except when they are separate.


print "Hello var1. You are in var2, etc."

I've seen print " "hello %s" % name " being used but I'm not sure how to add more text and variables.

My actual problem is that I need to print this line into a file.

<smiley shortcut=':)' checksum='d224f5890bad7f01e766cbcb9184d4703b65f413' filename='smile.png'/>
...where the values for shortcut, checksum and filename are variables in my python script.