Videos
I'm looking for projects that can help me practice for and while loops:
So far, I have mastered if statements, operators, and all the simple stuff, however, I have been struggling with loops for some time. I figure some practice projects could help me get the hang of it.
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.
It's hard to imagine any kind of program that wouldn't contain a loop; it's a pretty essential concept in the programmer's toolkit.
So really any project will make you write for loops. (Don't worry about while, it's actually used quite a bit less in Python.)
But I think better than practice is understanding. If you understand what for does then the conditions under which you should use it are pretty obvious.