title: python - finding circular prime number
body: <p>I am trying trying to find the number of circular primes from a given limit. The prime(x) will return whether a number is a prime or not. The rotations() will return a list of rotated numbers. Lastly, prime_count() will output the total amount of circular primes based on the given limit. Both prime() and rotations() gave me the correct output; however, prime_count() is not incrementing like it should. Any ideas on what i did wrong?</p>
  
  <pre><code>def prime(number): #return true or false
      return all(number% i for i in range(2,number))
  
  def rotations(num): #rotating number and return list
      list = []
      m = str(num)
      counter = 0 
      while counter &lt; len(str(num)):
          m=m[1:] + m[0]
          list.append(int(m))
          counter+=1
      list1=sorted(list,key=int)
      return list1
  
  def prime_count(limit): #return numbers of circular primes from given limit
      counter = 0 
  
      for i in range(1,limit+1):
          a=rotations(i)
          for j in a:
              if j == prime(j): 
                  counter+=1 
  
      return counter
  
  print(prime_count(100))
  </code></pre>