num=int(raw_input("Enter a number greater than 2: "))
my_list=[]
prime=1
print 2,
i = 3
gettingmultiples=3
while i <= num:
if not i in my_list:
print i,
prime=prime+1
while (gettingmultiples<=(num / i)):
my_list.append(i*gettingmultiples)
gettingmultiples=gettingmultiples+1
i=i+2
print
print "Primes Numbers: ", prime
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment