>>> tup = (1, 2, 3)
>>> print "Here it is: %s" % (tup,)
Here it is: (1, 2, 3)
>>>
Note that (tup,)
is a tuple containing a tuple. The outer tuple is the argument to the % operator. The inner tuple is its content, which is actually printed.
(tup)
is an expression in brackets, which when evaluated results in tup
.
(tup,)
with the trailing comma is a tuple, which contains tup
as is only member.