Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice Writing Loops in Python!
You have completed Practice Writing Loops in Python!
Preview
While loops are used to repeatedly loop through steps "while" a specific condition is true. Let's try this out with some examples.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
if you don't remember, will execute until
their condition evaluates as false.
0:00
Because of this,
they're known as indefinite loops,
0:04
because they can run
an indefinite number of times.
0:06
For loops on the other hand,
will only run a certain number of times.
0:08
I don't think it's even possible to
make infinite for loops in Python.
0:12
You can use the continue keyword
to skip an iteration of the loop.
0:15
Or you can use the break keyword
to completely stop the loop.
0:19
Both of those keywords work on for loops
too, but they're used there less often.
0:22
Let's take a look at the problems.
0:27
The first problem, warm the oven,
needs you to add 25 degrees to
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up