human
Write me a code to modular exponentiation ( Recursive ) and the other steps required given the following:
Modular exponentiation ( Recursive ) | Recursive Python program to compute modular power.
Base Cases.
If B is Even.
If B is Odd.
Driver Code"
Solution in Python:
assistant
#Here is code to modular exponentiation ( Recursive ) and the other steps required.
 def exponentMod ( A , B , C ) :
	if ( A == 0 ) :
		return 0
	if ( B == 0 ) :
		return 1
	y = 0
	if ( B % 2 == 0 ) :
		y = exponentMod ( A , B / 2 , C )
		y = ( y * y ) % C
	else :
		y = A % C
		y = ( y * exponentMod ( A , B - 1 , C ) % C ) % C
	return ( ( y + C ) % C )
A = 2
B = 5
C = 13
print ( " Power ▁ is " , exponentMod ( A , B , C ) )