human
Check if a number is Full Prime | function to check digits.
check all digits are prime or not.
check if digits are prime or not.
To check if n is prime or not.
check for all factors.
To check if n is Full Prime.
The order is important here for efficiency ..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to check if a number is Full Prime and the other steps required.
 def checkDigits ( n ) :
	while ( n ) :
		dig = n % 10
		if ( dig != 2 and dig != 3 and dig != 5 and dig != 7 ) :
			return 0
		n = n / 10
	return 1
def prime ( n ) :
	if ( n == 1 ) :
		return 0
	i = 2
	while i * i <= n :
		if ( n % i == 0 ) :
			return 0
		i = i + 1
	return 1
def isFullPrime ( n ) :
	return ( checkDigits ( n ) and prime ( n ) )
n = 53
if ( isFullPrime ( n ) ) :
	print ( " Yes " )
else :
	print ( " No " )