Python: Sixteen - Deepstash
Python: Sixteen

Python: Sixteen

1 IDEA

3 reads

Python: Sixteen

💻 working

Keep reading for FREE

Learning Python: While loops

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

3 reads

1

It's time to
Read like a Pro.

Jump-start your

reading habits

, gather your

knowledge

,

remember what you read

and stay ahead of the crowd!

Save time with daily digests

No ads, all content is free

Save ideas & add your own

Get access to the mobile app

2M+ Installs

4.7 App Rating

CURATED BY

samuelbancroft

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

CURATOR'S NOTE

this will explain a little about while loops