title: How to find the common factors of 2 numbers
body: <p>Print the number of common factors of a and b.</p>
  
  <p>input  > 10, 15</p>
  
  <p>Output > 2</p>
  
  <p>The common factors of 10, 15 are 1 and 5</p>
  
  <p>My code</p>
  
  <pre><code>def print_factors(x,y):
  l = []
  for i in range(1, x + 1):
      if x % i == 0:
          l.append(i)
  m = []
  for i in range(1, y + 1):
      if y % i == 0:
          m.append(i)
  print (list(set(l).intersection(m)))
  num1 = int(input("Enter a number: ")) #10
  num2 = int(input("Enter a number: ")) #15
  print_factors(num1,num2)
  </code></pre>
  
  <p>Is there any better way to optimize, like list comprehension. or using zip module</p>