recurring

Calculate period length of recurring decimal fraction

Calculate period length of recurring decimal fraction Question: I want to do a program in python (3.6.5) that tell the length of e.g. 1/7. The output should be for this example something like: “length: 6, repeated numbers: 142857”. I got this so far: n = int(input(“numerator: “)) d = int(input(“denominator: “)) def t(n, d): x …

Total answers: 2