human
Find the winner in nim | Function to find winner of NIM - game.
case when Alice is winner.
when Bob is winner.
Driver code"
How can the above be solved in Python?
 Can you provide a code to find the winner in nim and the other steps required?
assistant
#Here is code to find the winner in nim and the other steps required.
 def findWinner ( A , n ) :
	res = 0
	for i in range ( n ) :
		res ^= A [ i ]
	if ( res == 0 or n % 2 == 0 ) :
		return " Alice "
	else :
		return " Bob "
A = [ 1 , 4 , 3 , 5 ]
n = len ( A )
print ( " Winner ▁ = ▁ " , findWinner ( A , n ) )