Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_prime(n):
- d = 2
- while d * d <= n and n % d != 0:
- d += 1
- return d * d > n
- def is_total_prime(n):
- return False if any([x not in "2357" for x in n]) else True
- def get_total_primes(a, b):
- c = 0
- for i in range(a,b+1):
- if is_total_prime(str(i)):
- if is_prime(i):
- c+=1
- return c
Advertisement
Add Comment
Please, Sign In to add comment