def reverse_fact(input): start = 1 while input % start == 0: input /= start print(input) if input == 1: return start start += 1 return 0
- def reverse_fact(input):
- start = 1
while input != 1:start += 1if input % start != 0 :return 0- while input % start == 0:
- input /= start
- print(input)
return start- if input == 1: return start
- start += 1
- return 0
test.assert_equals(reverse_fact(24), 4) test.assert_equals(reverse_fact(120), 5) test.assert_equals(reverse_fact(362880), 9) test.assert_equals(reverse_fact(1), 1) test.assert_equals(reverse_fact(25), 0) test.assert_equals(reverse_fact(0.31), 0)
- test.assert_equals(reverse_fact(24), 4)
- test.assert_equals(reverse_fact(120), 5)
- test.assert_equals(reverse_fact(362880), 9)
- test.assert_equals(reverse_fact(1), 1)
test.assert_equals(reverse_fact(25), 0)- test.assert_equals(reverse_fact(25), 0)
- test.assert_equals(reverse_fact(0.31), 0)