import itertools

print '\n'.join(['{0}x{1}={2}'.format(i,j,i*j) for i,j in itertools.product(xrange(1,10),repeat=2)]) import itertools itertools print '{0}x{1}={2}'.format(i,j,i*j) for i,j in itertools.product(xrange(1,10),repeat=2) for i,j in itertools.product(xrange(1,10),repeat=2) i j itertools.product(xrange(1,10),repeat=2) itertools.product itertools product xrange(1,10) xrange 1 10 repeat=2 repeat 2 for i,j in itertools.product(xrange(1,10),repeat=2) '{0}x{1}={2}'.format(i,j,i*j) '{0}x{1}={2}'.format '{0}x{1}={2}' format i j i*j i j '\n'.join(['{0}x{1}={2}'.format(i,j,i*j) for i,j in itertools.product(xrange(1,10),repeat=2)]) '\n'.join '\n' join ['{0}x{1}={2}'.format(i,j,i*j) for i,j in itertools.product(xrange(1,10),repeat=2)]
import itertools

print '\n'.join(['{0}x{1}={2}'.format(i,j,i*j) for i,j in itertools.product(xrange(1,10),repeat=2)])