Executing code repeatedly with a while loop

Опубликовано: 17 Апрель 2026
на канале: Alexander Hess - Pythonista
422
12

In this video, I introduce the while statement and compare while-loops with for-loops. The latter are a special case of the former and can only be used if we can predict the end of a loop (e.g. when looping over range(1, 11) we know that 10 is the last number). while-loops take a condition and run as long as the condition is true. Also, we must usually "manage" the variable over which we loop "manually" in a while-loop.

PYTHON BOOK
The lecture is based on the free book "Introduction to Python & Programming".
Get it on GitHub: https://github.com/webartifex/intro-t...

SUBSCRIBE
If you like the way I teach and talk about programming and data science, subscribe to this channel.
The videos focus on coding courses and tutorials aimed at managers and students of business administration, enabling them to make better decisions with analyses done in code.

INSTRUCTOR
Alexander Hess, PhD Student
WHU - Otto Beisheim School of Management, Vallendar, Germany

CONTACT
GitHub: https://github.com/webartifex
LinkedIn:   / webartifex  
XING: https://xing.to/webartifex
Facebook:   / webartifex  
Instagram:   / webartifex  
Website: http://www.webartifex.biz
YouTube:    / webartifex  

wa-vid-047