human
Give me a code to maximize count of empty water bottles from N filled bottles and the other steps required given the following:
Maximize count of empty water bottles from N filled bottles | Function to find the maximum bottles that can be emptied.
Iterate until a is non - zero.
Add the number of bottles that are emptied.
Update a after exchanging empty bottles.
Stores the number of bottles left after the exchange.
Return the answer.
Driver Code.
Function call"
How can the above be solved in Python?
assistant
#Here is code to maximize count of empty water bottles from N filled bottles and the other steps required.
 def maxBottles ( n , e ) :
	s = 0
	b = 0
	a = n
	while ( a != 0 ) :
		s = s + a
		a = ( a + b ) // e
		b = n - ( a * e )
		n = a + b
	return s
if __name__ == ' _ _ main _ _ ' :
	n = 9
	e = 3
	s = maxBottles ( n , e )
	print ( s )