Mastering While Loops

Katy Gibson

Katy Gibson 11 Lessons 26m
basics python

Master indefinite iteration using the Python “while” loop. You’ll be able to construct basic and complex while loops, interrupt loop execution with break and continue, use the else clause with a while loop, and deal with infinite loops.

The editor used in this course is Thonny: The Beginner-Friendly Python Editor. Checkout our article about Thonny. It covers the setup and usage as well as best practises.

About Katy Gibson

Katy Gibson

Katy is a full-stack web developer with experience in high school science education. She enjoys teaching and learning and is just really excited to be here.

» More about Katy

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Participant Comments

Bill on March 13, 2019

Katy, Really well done, made while loops readily understandable. Thank you.

I changed the fizz, baz, buzz to one, two, three, just so I could more readily identify where I was and what was going on. Probably more of my dyslexia than anything else.

ChrisF on March 16, 2019

Great set of tutorials - Loved them!

estis on April 24, 2019

The tutorial was very good!

sion on May 13, 2019

Very good tutorial. It took me to places that I’ve not been before. Thank you.

kcalhoun98 on May 21, 2019

This un-confused me about the order of operations in a nested while loop. Thank you!!

Jean Ferreira on Sept. 4, 2019

Well done Katy. You made it very easy to understand and also you used a great tool to help us see step-by-step how everything works. Looking forward for more videos from you.

« Browse All Courses