I am just getting into coding and have been practicing on some basic math problems from Project Euler. I have simply been writing these programs in Jupyter notebooks. I am only on question 5, a very basic prompt, and a very basic answer, and for some reason it has become progressively harder to actually run the code and get an output. Here is the code I am trying to run:
nums = []
for n in range(1, 30000):
i = 1
while i < 11:
quo = n % i
if quo != 0: break
if quo == 0: i =+ 1
if i == 10 and quo == 0: nums.append(n)
print(nums)
When I run it, the program simply never stops running and so never gives me an output. I don't think it has anything to do with the code, because I ran it before and it worked. I also tried running it in Spyder but had the same problem. Is this a problem with my computer, or with the way I am running the code?
For context, here is the Euler prompt I was working on:
"2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?"
The code above is just trying to reproduce the example results (get 2520 back).