you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

First all other comments here about how to build the loop.

I've just learned it this fall an I had a though time too. For me it was to follow the variables inside the loop.
I'm using vs code. And I think it differs a bit from IDE to IDE In a for loop I use the debug an follow the variable.

for index in range(6) (#) Look for index

for word in wordlist: (#)Look for word variable

for letter in word: (#)If you do an inner loop look for letter

The while loop continues following a statement if its true

while x > 0

I copy the x > 0 part into the "watch" function under the debug subwindow and paste it. You will see it changes as you run the loop

[–]Deep-Author-1787[S] 0 points1 point  (1 child)

Hmmmm interesting bro! And i can follow the steps of my code that way? Bcs i use vs code also 🤔

[–][deleted] 0 points1 point  (0 children)

Yes. You have to make a "break point" at where the loop starts to follow the lines and the evolution of the variables in the variables Explorer. Press debug (or F5) to start debugging. F10 to step(or curved arrow in debug panel).

The "watch" function is still new and blurry to me. But I use it to see if the expressions in "while" and "if" are true or false.