Closed Casper17-max closed 3 years ago
Hi Casper
It seems that i only increases by 1 when your if statement is true. This causes i to get stuck at numbers where the condition is not satisfied. This could for instance be 1. Consider rearranging your loop just a tiny bit.
Please let me know if this was not helpful.
Best, Joachim
I have tried to move things around and Google, but i don't understand why it's still wrong, and how the notation of an if statement in a while loop should be.
You seem to have a problem with the indentation. It seems that you have indented i += 1 twice. What happens if you don't indent it? What happens if you indent it once?
Best, Joachim
When I don't indent and indent once, I get the following errors after interrupting the kernel, respectively:
Instead of writing i =+ 1
, try and write i += 1
. With the former, you basically just say that i = 1 as 1 is implicitly a positive (+) number. I can recomment simply writing i = i +1
when in doubt.
Does it work now?
Best, Joachim
It worked, thank you :-)
When I try to run this code, it says 'Kernel busy' with a black circle instead of a white one:![image](https://user-images.githubusercontent.com/86822716/125107303-f3a67280-e0e0-11eb-8b02-03bdfa5bbee5.png)
When I interrupt the Kernel, it says this:![image](https://user-images.githubusercontent.com/86822716/125107716-6adc0680-e0e1-11eb-9b21-c66184b73184.png)
It seems like the problem is somewhere in line 3 (the arrow) but I don't know why.