Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Let's discuss the tasks we need to cover for this review of Python while loops.
Need help?
You can always review the While Loops video from Python Basics.
-
0:00
[MUSIC]
-
0:09
Howdy, Ken here.
-
0:10
In this Python practice session,
-
0:12
you'll get a chance to practice working with While Loops.
-
0:15
It reinforces what you've learned.
-
0:17
If you find this practice session too challenging to complete,
-
0:21
you might need to review a few videos.
-
0:23
I've put a few links in the teacher's notes for some resources.
-
0:26
We'll be using workspaces for this practice.
-
0:29
Go ahead and open up the attached workspace.
-
0:32
Inside, looping.py, there's some starter code.
-
0:35
The starter code includes some TODO tasks for you to complete.
-
0:39
The task at hand is to ask someone if they understand While Loops.
-
0:44
While they answer no, you print out an explanation of while loops.
-
0:49
If they answer yes, you print out a nice message,
-
0:51
thanking them for learning about while loops.
-
0:54
Let's see it working in action.
-
0:57
Give ourself some space here Looping.py.
-
1:05
I'm asked for my name, my name is Ken.
-
1:10
And then if I understand while loops in Python.
-
1:13
And look at that, the prompt even uses my name.
-
1:16
If I answered no to the question, or actually anything other than yes,
-
1:22
again a message explaining Python while loops.
-
1:25
It then asks me again, using my name, if I understand while loops.
-
1:31
As long as I keep answering no, I get the same message.
-
1:36
When I enter yes, I get a nice message and the program ends.
-
1:42
Don't worry if you get stuck along the way.
-
1:44
I've included some links in the teacher's notes to videos that cover the concepts
-
1:48
needed to complete this practice session.
-
1:51
When we get back together, I'll walk you through how I did this challenge.
-
1:55
See you then, and happy coding.
You need to sign up for Treehouse in order to download course files.
Sign up