human
Check whether product of digits at even places of a number is divisible by K | Function checks whether product of digits at even places is divisible by K.
Converting integer to string.
Traversing the string.
Driver code"
How can the above be solved in Python?
 Write me a code to check whether product of digits at even places of a number is divisible by K and the other steps required?
assistant
#Here is code to check whether product of digits at even places of a number is divisible by K and the other steps required.
 def productDivisible ( n , k ) :
	product = 1
	num = str ( n )
	for i in range ( len ( num ) ) :
		if ( i % 2 == 0 ) :
			product = product * int ( num [ i ] )
	if product % k == 0 :
		return True
	return False
n = 321922
k = 3
if productDivisible ( n , k ) == True :
	print ( " YES " )
else :
	print ( " NO " )