Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getint():
- x = int(input("Give a number to check if it is a prime: "))
- return x
- y = getint()
- z = range(1, y-1)
- for i in z:
- if(y%i==0 and i>1):
- print("notaprime")
- break
- elif(y%i==1 and i>1):
- continue
- elif(y%2==1 and i==1):
- print("Prime")
- else:
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement