prime.py 320 Bytes
Newer Older
Sai Mounika's avatar
Sai Mounika committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
a=input("enter a range")
n=input("enter a number")
count=0
for i in range(2,a):
	if n%i==0:
	        count=count+1
	        i=i+1
	else:
	        count=count
if(count>1):
        print n
        print "is not prime num"
else:
        print n,"is prime"
    '''output:
    enter a range20
enter a number17
17 is prime
'''