Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l = []
- output = []
- num = int(input("Enter a number: "))
- def findCombinations(n, product):
- global output
- if product == num:
- output.append([l])
- return output
- for x in range(n, int(num/2)+1):
- if product*x > num:
- return
- product = product * x
- l.append(x)
- findCombinations(x, product)
- l.pop()
- product = product//x
- print(findCombinations(2,1))
Advertisement
Add Comment
Please, Sign In to add comment