Looking for practice while loop questions
Ideas for practicing for and while loops?
For: print out only even numbers between 1 and 100. Now do it without using an if statement.
While: Ask the user for a secret password. Keep going until they get it right. Now do the same without using an if statement.
These are probably the most basic ideas. Once you have them down, you can build on your knowledge.
More on reddit.comFor loops and while loops
I get what you are saying :) I need a lot of practice for stuff to stick. When I was learning conditionals and looping, the best advice I got was to start with some practice problems, then make up similar problems with my own data and scenarios. For example, you could write a program to loop through a list of addresses and have it return some information about each entry. Or, you could write a program to take keyboard input and keep printing some result until you enter 'N' (the while loop in action). We were also told to try to solve the problems without using while or for loops to help motivate why you would want them in the first place. That really helped solidify the concepts for me, because you can write code without the loops, but it gets long and tedious... Btw, another link I used was https://www.practicepython.org/.
More on reddit.comSome while loop exercises
What can maybe help as well is to run the snippets at http://www.pythontutor.com/visualize.html as then you can walk through them step by step, also seeing the values of the variables.
More on reddit.com