human
Find probability that a player wins when probabilities of hitting the target are given | Function to return the probability of the winner.
Driver Code.
Will print 9 digits after the decimal point"
How can the above be solved in Python?
assistant
#Here is code to find probability that a player wins when probabilities of hitting the target are given and the other steps required.
 def find_probability ( p , q , r , s ) :
	t = ( 1 - p / q ) * ( 1 - r / s )
	ans = ( p / q ) / ( 1 - t ) ;
	return round ( ans , 9 )
if __name__ == " _ _ main _ _ " :
	p , q , r , s = 1 , 2 , 1 , 2
	print ( find_probability ( p , q , r , s ) )