I want to store factorials of numbers in range 1 to 200,000 but as the factorials for larger numbers are very big my program is running out of space. Is there any way I can store them in a array?
My code:
factorial_of_numbers = []
factorial_of_numbers = [factorial_of_numbers[-1] for x in range(0, 200001) if not factorial_of_numbers.append(x*factorial_of_numbers[-1] if factorial_of_numbers else 1)]
With this approach I am only able to store factorial till 10,000.
Can anyone suggest any other approach or how to store big factorials?