Вот решение без генератора
#when doing long division on a pair of numbers, (a,b), when you proceed through the algorigthm,
#you get new pairs (rem,b). You stop the algorithm when rem==0 or when the remainder is present
#in the existing list of digits
def decimals(number):
dividend = 1
digit = []
while dividend:
if dividend//10 in digit:
return digit
digit += [dividend // number]
dividend = dividend % number * 10
более упрощенная версия, опять же не генератор, будет
def decimals(number):
dividend = 1
digit = []
while dividend and dividend//10 not in digit:
digit += [dividend // number]
dividend = dividend % number * 10
return digit