human
What is a code to first occurrence of a digit in a given fraction and the other steps required given the following:
First occurrence of a digit in a given fraction | function to print the first digit.
reduce the number to its mod.
traverse for every decimal places.
get every fraction places when ( a * 10 / b ) / c.
check if it is equal to the required integer.
mod the number.
driver code to test the above function"
How can the above be solved in Python?
assistant
#Here is code to first occurrence of a digit in a given fraction and the other steps required.
 def first ( a , b , c ) :
	a %= b
	for i in range ( 1 , b + 1 ) :
		a = a * 10
		if int ( a / b ) == c :
			return i
		a %= b
	return - 1
a = 1
b = 4
c = 5
print ( first ( a , b , c ) )