Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def saisie():
- n=input("n:")
- return n
- def premier(n):
- c=0
- for i in range(2,(n//2)+1):
- if n%i==0:
- c=c+1
- return (c==0)
- def superpremier(n):
- test=True
- i=len(n)-1
- while test==True and i!=0:
- if not(premier(int(n[0:i]))==True):
- test=False
- i=i-1
- return test==True
- n=saisie()
- if superpremier(n)==True:
- print("est super premier")
- else:
- print("non")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement