Im a beginner programmer trying to learn Python and taking an video intro course. I don't have any other resources to ask, and found this forum.
I almost have to apologize for this but its bugging me to know what the problem is instead of moving on.
This is a pretty simple while loop.
I am using PyCharm 3.8, and the tutor in the video is using PyCharm 3.5.
The screens and output appear to be the same between the programmer and I.
Code is exactly the same but output is different in the second case.
Below is the first example, that works great, simple enough:
I understand what it is supposed to do but don't understand why its running a different output from what I can obviously see as the 0,1,2,3 then break, in the video. There are no errors just a continuous stream.
Thank you in advance
I almost have to apologize for this but its bugging me to know what the problem is instead of moving on.
This is a pretty simple while loop.
I am using PyCharm 3.8, and the tutor in the video is using PyCharm 3.5.
The screens and output appear to be the same between the programmer and I.
Code is exactly the same but output is different in the second case.
Below is the first example, that works great, simple enough:
c=0 >>> while c<5: ... print(c) ... c=c+1 ... 1 2 3 4Programmer changes the code and adds a break statement that ends the output at 3, and output is clearly correct in the video:
c=0 while c<5: print(c) if c == 3: break c=c+1 0 1 2 3I run this code and i get continuous stream of 0s that I have to ctl-c out of.
I understand what it is supposed to do but don't understand why its running a different output from what I can obviously see as the 0,1,2,3 then break, in the video. There are no errors just a continuous stream.
Thank you in advance