human
Find length of period in decimal value of 1 / n | Function to find length of period in 1 / n.
Find the ( n + 1 ) th remainder after decimal point in value of 1 / n.
Store ( n + 1 ) th remainder.
Count the number of remainders before next occurrence of ( n + 1 ) ' th ▁ remainder ▁ ' d.
Driver Code"
Solution in Python:
 Can you provide a code to find length of period in decimal value of 1 / n and the other steps required?
assistant
#Here is code to find length of period in decimal value of 1 / n and the other steps required.
 def getPeriod ( n ) :
	rem = 1
	for i in range ( 1 , n + 2 ) :
		rem = ( 10 * rem ) % n
	d = rem
'
	count = 0
	rem = ( 10 * rem ) % n
	count += 1
	while rem != d :
		rem = ( 10 * rem ) % n
		count += 1
	return count
if __name__ == " _ _ main _ _ " :
	print ( getPeriod ( 3 ) )
	print ( getPeriod ( 7 ) )