human
Primality test for the sum of digits at odd places of a number | Function that return sum of the digits at odd places.
Function to check if a number is prime.
Corner cases.
This is checked so that we can skip middle five numbers in below loop.
driver code.
Get the sum of the digits at odd places"
Solution in Python:
 ... What is a code to primality test for the sum of digits at odd places of a number and the other steps required?
assistant
#Here is code to primality test for the sum of digits at odd places of a number and the other steps required.
 def sum_odd ( n ) :
	sums = 0
	pos = 1
	while ( n != 0 ) :
		if ( pos % 2 == 1 ) :
			sums += n % 10
		n = n // 10
		pos += 1
	return sums
def check_prime ( n ) :
	if ( n <= 1 ) :
		return False
	if ( n <= 3 ) :
		return True
	if ( n % 2 == 0 or n % 3 == 0 ) :
		return False
	for i in range ( 5 , n , 6 ) :
		if ( n % i == 0 or n % ( i + 2 ) == 0 ) :
			return False
	return True
n = 223
sums = sum_odd ( n )
if ( check_prime ( sums ) ) :
	print ( " YES " )
else :
	print ( " NO " )