print & string formatting

Sharan Basappa sharan.basappa at
Sun Jul 22 00:33:59 EDT 2018


I get a lot confused while using print functions in Python.

For example, I get the same results for the following code:

str = "one two three"

print str
print "%s" %(str)

So, what is the need to use the second method which I see being used in many programs I am referring to

More information about the Python-list mailing list