Python for Engineers
Solve Problems by Coding Solutions - A Complete solution for python programming
Blog Pages
Blog
News
Distributions
NumPy Tutorials
Self Learning
IDE
Packages
About
To check the number is Prime or Not
n=int(raw_input('Enter the number to check:'))
flag=0
i=2
while(i<=(n/2)):
if (n%i==0):
flag=1
i=i+1
if(flag==0):
print 'The number ',n, ' is prime number'
else:
print 'The number ',n, ' is not prime number'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment