Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isprime(n ) :
- for i in xrange( 2, n/2 +1 ) :
- if n % i == 0 :
- return False
- return True
- def isnumberunique( n ) :
- s = str( n )
- for ch in set(s) :
- if s.count(ch) > 1 :
- return False
- return True
- num = pow( 10 ,9)
- naed = [0,2,4,5,6,8]
- naed =map(str,naed)
- while num :
- while isnumberunique(num) is False and str(num)[-1] not in naed :
- num -= 1
- if isprime( num):
- print num
- break
- else :
- num -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement