I am new to programming and wanted to create a small program that can take a user input (a natural number) and returns all possible natural numbers that can be multiplied together to get to this outcome. Up until now I have created a "def find_factors" which seems to work and now I want to basically print always the first and the last numbers , divided by a "*", then second factor and second last factor, third and third last and so on...to display all possibilities.
**EXAMPLE the factors of 2048 would be [1,2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,2048], so now I need some code that prints -->1 times 2048, 2 times 1024, 4 times 512, 8 times 256, 16 times 128, 32 times 64
CODE FOR FINDING FACTORS:
def find_factors(user_input):
factors = []
for x in range(1,user_input+1):
if user_input % x == 0:
factors.append(x)
return factors
I would appreciate to hear any kind of comment or reply on how I could go about doing this, so thanks a lot for any insight.