title: How to count total Prime numbers within a gven range
body: <p>I was trying to find the prime numbers within a range (input will be decided by user) and total count of prime numbers.</p>
  
  <p>I am able to find the prime numbers but not able to do the part--counting the prime numbers.
  Can any one help me?
  here is the program</p>
  
  <pre><code>#!/usr/bin/env python
  import math
  
  lower=input("lower value:")
  upper=input("upper value:")
  print("prime numbers between", lower,"and", upper, "are:")
  for num in range (lower, upper+1):
   if num&gt;1:
    for i in range (2,num):
     if num % i==0:
      break
    else: print(num)
  def  count_prime(num,lower,upper):
    count_prime= 0
    for x in num:
      if lower &lt;= x &lt;= upper:
        count_prime += 1
  print ( "count_prime:",count_prime )
  </code></pre>
  
  <p>result output is as follows ( range between 10 and 100)</p>
  
  <p>('prime numbers between', 10, 'and', 100, 'are:')
  11
  13
  17
  19
  23
  29
  31
  37
  41
  43
  47
  53
  59
  61
  67
  71
  73
  79
  83
  89
  97
  ('count_prime:', )</p>