human
What is a code to winner in the Rock and the other steps required given the following:
Winner in the Rock | Function to return the winner of the game.
Both the players chose to play the same move.
Player A wins the game.
Function to perform the queries.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to winner in the Rock and the other steps required.
 def winner ( moves ) :
	data = dict ( )
	data [ ' R ' ] = 0
	data [ ' P ' ] = 1
	data [ ' S ' ] = 2
	if ( moves [ 0 ] == moves [ 1 ] ) :
		return " Draw "
	if ( ( ( data [ moves [ 0 ] ] | 1 << ( 2 ) ) - ( data [ moves [ 1 ] ] | 0 << ( 2 ) ) ) % 3 ) :
		return " A "
	return " B "
def performQueries ( arr , n ) :
	for i in range ( n ) :
		print ( winner ( arr [ i ] ) )
arr = [ " RS " , " SR " , " SP " , " PP " ]
n = len ( arr )
performQueries ( arr , n )