human
Write me a code to check if given number is Emirp Number or not and the other steps required given the following:
Check if given number is Emirp Number or not | Returns true if n is prime . Else false ..
Corner case.
Check from 2 to n - 1.
Function will check whether number is Emirp or not.
Check if n is prime.
Find reverse of n.
If both Original and Reverse are Prime , then it is an Emirp number.
Input number"
How can the above be solved in Python?
assistant
#Here is code to check if given number is Emirp Number or not and the other steps required.
 def isPrime ( n ) :
	if n <= 1 :
		return False
	for i in range ( 2 , n ) :
		if n % i == 0 :
			return False
	return True
def isEmirp ( n ) :
	n = int ( n )
	if isPrime ( n ) == False :
		return False
	rev = 0
	while n != 0 :
		d = n % 10
		rev = rev * 10 + d
		n = int ( n / 10 )
	return isPrime ( rev )
n = 13
if isEmirp ( n ) :
	print ( " Yes " )
else :
	print ( " No " )