human
Find if it is possible to get a ratio from given ranges of costs and quantities | Returns true if it is possible to get ratio r from given cost and quantity ranges ..
Calculating cost corresponding to value of i.
Driver Code"
How can the above be solved in Python?

=====
What is a code to find if it is possible to get a ratio from given ranges of costs and quantities and the other steps required?
assistant
#Here is code to find if it is possible to get a ratio from given ranges of costs and quantities and the other steps required.
 def isRatioPossible ( lowCost , upCost , lowQuant , upQuant , r ) :
	for i in range ( lowQuant , upQuant + 1 ) :
		ans = i * r
		if ( lowCost <= ans and ans <= upCost ) :
			return True
	return False
lowCost = 14 ; upCost = 30
lowQuant = 5 ; upQuant = 12 ; r = 9
if ( isRatioPossible ( lowCost , upCost , lowQuant , upQuant , r ) ) :
	print ( " Yes " )
else :
	print ( " No " )