Advertisement
ke1dan

Untitled

Jul 10th, 2020
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. def is_prime(n):
  2.     if n<2:return False
  3.     for i in range(2,int(n**(1/2))+1,):
  4.         if not n%i:return False
  5.     return True
  6.  
  7. def is_total_prime(n):
  8.     for i in str(n):
  9.         if int(i) not in (2,3,5,7):return False
  10.     return True
  11.  
  12. def get_total_primes(a, b):
  13.     c = 0
  14.     for i in range(a,b+1):
  15.         if is_prime(i) and is_total_prime(i):
  16.             c+=1
  17.     return c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement