title: How can I print space separated tuples of cartesian product of 2 lists using list comprehension?
body: <p>I have written the below code:</p>
  
  <pre><code>import itertools
  for each in list(itertools.product(list1,list2)):
      print each,
  </code></pre>
  
  <p>It works fine, but I want to learn how to write to print each tuple of this cartesian product list in the same line separated by a space using list comprehension.</p>
  
  <p>Ouput should be something like:</p>
  
  <p>(1, 3) (1, 4) (2, 3) (2, 4)</p>
  
  <p>is list1 = [1,2] &amp; list2 = [3,4]</p>
  
  <p>I tried but syntax error comes. Please help, thanks in advance.</p>