human
Write me a code to multiply two integers without using multiplication , division and bitwise operators , and no loops and the other steps required given the following:
Multiply two integers without using multiplication , division and bitwise operators , and no loops | Function to multiply two numbers x and y.
0 multiplied with anything gives 0.
Add x one by one.
The case where y is negative.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to multiply two integers without using multiplication , division and bitwise operators , and no loops and the other steps required.
 def multiply ( x , y ) :
	if ( y == 0 ) :
		return 0
	if ( y > 0 ) :
		return ( x + multiply ( x , y - 1 ) )
	if ( y < 0 ) :
		return - multiply ( x , - y )
print ( multiply ( 5 , - 11 ) )