human
Modify N by adding its smallest positive divisor exactly K times | Function to find the smallest divisor of N greater than 1.
If i is a divisor of N.
If N is a prime number.
Function to find the value of N by performing the operations K times.
If N is an even number.
Update N.
If N is an odd number.
Update N.
Driver Code"
How can the above be solved in Python?

Write me a code to modify N by adding its smallest positive divisor exactly K times and the other steps required?
assistant
#Here is code to modify N by adding its smallest positive divisor exactly K times and the other steps required.
 def smallestDivisorGr1 ( N ) :
	for i in range ( sqrt ( N ) ) :
		i += 1
	if ( N % i == 0 ) :
		return i
	return N
def findValOfNWithOperat ( N , K ) :
	if ( N % 2 == 0 ) :
		N += K * 2
	else :
		N += smallestDivisorGr1 ( N ) + ( K - 1 ) * 2
	return N
N = 6
K = 4
print ( findValOfNWithOperat ( N , K ) )