The way i see it is while loops work like if statements but in a loop. Lets just think about it, if statements need a condition to run the code in its scope, a while loop only runs the code in its scope if the condition is true, in this case i did a while True, this would technically run for forever and not stop but i put a break in which stops as soon as reaches this point, in the next loop i added a condition which, but in the scope i am removing 1 from x, which eventually then will make the condition false which then stops the while loop cause the condition is false.
1
5 reads
CURATED FROM
IDEAS CURATED BY
Keep reading, keep studying, the more you learn the more you change. If you are doing the Python lessons please join this discord channel https://discord.gg/kugXx9KY but please follow the rules
this will explain a little about while loops
“
Similar ideas to Learning Python: While loops
As you can see in the image, we are working with conditional if statements. This is used to find out if something is True or False. As you can see i used '
The first thing we need to consider when starting to learn a programming language, is what shall we use. There are a few things we can use, for example python IDLE, pycharm, VS code, notepad++, anaconda or Google Colab.
For these lessons I would recommend pycharm. But first we need to insta...
If 'entitled to have your opinion' means everyone has the right to say what they want, the statement is true, but not necessarily important.
If 'entitled to have your opinion' means your statements are serious candidates for truth, then it's false. And this too is a distinction that tends t...
Read & Learn
20x Faster
without
deepstash
with
deepstash
with
deepstash
Personalized microlearning
—
100+ Learning Journeys
—
Access to 200,000+ ideas
—
Access to the mobile app
—
Unlimited idea saving
—
—
Unlimited history
—
—
Unlimited listening to ideas
—
—
Downloading & offline access
—
—
Supercharge your mind with one idea per day
Enter your email and spend 1 minute every day to learn something new.
I agree to receive email updates