title: Python - Counting Prime Factors
body: <p>I'm a Python newbie so I apologize if the answer is obvious and I'm oblivious to something simple.</p>
  
  <p>I'm trying to count the number of factors of a prime number so that it will print: "It has X factors," but I'm running against a brick wall - I'm not sure how or the best way to count the number of previously generated list.</p>
  
  <p>I'm also confused on part of my Prime Number determination. It generally works well, but when I input numbers like 15, 25, 35, etc. it all comes back as saying the number is prime when they aren't. It isn't all multiples of 5 either.</p>
  
  <p>All help is appreciated!</p>
  
  <p>My code:</p>
  
  <pre><code># Main Program
  
  def main():
   choice = "y"
   while choice.lower() == "y":
        print ("Prime Number Checker")
        print ()
        is_prime()
        print()
        choice = input("Try Again (y/n)?: ")
   choice = "n"
   while choice.lower() == "n":
        break
  
  # Prime number determination and Output
  
  def is_prime():
        num = int(input("Please enter an integer between 1 and 5,000: "))
        if num &gt; 1:
             for i in range (2, num):
                  if (num % i) != 0:
                            print()
                            print ("The factors of your number are:")
                            factors (num)
                            print (num, "is a Prime Number")
                            break
                  elif (num % i) == 0:
                            print ()
                            print ("The factors of your number are:")
                            factors (num)
                            print (num, "is NOT a Prime Number")
                            numfacs (num)
                            break
        else:
             print ()
             print ("Number not in range.")
             print ()
  
  # Factor Determination and Output
  
  def factors(num):
   for i in range (1, num+1):
        if (num % i == 0):
             print (i)
  
  # Number of Facotors and Output
  
  def numfacs(num):
   for i in range (1, num+1):
        if (num % i == 0):
             list = []
             print ("Length: ", len(list))
             break
  
  if __name__ == "__main__":
  main()
  </code></pre>