title: python - returning values for which if statement is true
body: <p>I am starting out in Python and have a question about the following piece of code:</p>
  
  <pre><code>def prime2(n):
      n = eval(input("What is your number? "))
      for i in range(2, int(math.sqrt(n)) + 1):
  
          if n % i == 0:
              return False
          else:
              return True
  </code></pre>
  
  <p>So when <code>True</code> is returned, <code>n</code> is prime.  Now is there a way to list all the values of <code>n</code> for which the if statement is true?</p>