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)
Talk is cheap, show you the code:
>>> tup = (10, 20, 30) >>> i = 50 >>> print '%d %s'%(i,tup) 50 (10, 20, 30) >>> print '%s'%(tup,) (10, 20, 30) >>>