Python print function

I need help in Python to print:

I have:

input = [(3, 'x1'), (5, 'x3'), (2, 'x2')]

must be printed in this form:

x1=3 x2=2 x3=3 

Many thanks

+4
source share
2 answers
 print ' '.join('%s=%s' % (k, v) for (v, k) in input) 
+9
source
 for x,y in input: print "%s=%s" % (y, x), 
+4
source

All Articles