So, i have this problem. I got tuple (1,2,3) which i should print with string formatting. eg.
tup = (1,2,3) print \"this is a tuple %something\" % (tup)
>>> thetuple = (1, 2, 3) >>> print "this is a tuple: %s" % (thetuple,) this is a tuple: (1, 2, 3)
Making a singleton tuple with the tuple of interest as the only item, i.e. the (thetuple,) part, is the key bit here.
(thetuple,)