<

Python Programming: While and For Loops

Posted on
6,307 Points
207 Views
1 Endorsement
Last Modified:
Published
Experience Level: Beginner
4:07
Learn the basics of while and for loops in Python.

Video Steps

1. while loops are used for testing while, or until, a condition is met

2. The structure of a while loop is as follows: while <condition>: do something repeate

3. The break statement may be used to exit a while loop when a condition is met

4. for loops iterate through a sequence or range a specified amount

5. The structure of a for loop is as follows: for <every element> in a <a sequence or range>: do something

6. The continue statement may be used to exit an iteration of a for loop, but not the loop itself.

1
Author:Dototot
0 Comments
Which language to choose for your next web project? Python, PHP, or maybe Node.js? Which framework to choose? Should you go with Symphony, Yii, or Laravel in PHP world? Django, Pyramid or Flask in Python world? Or maybe go for Feathers, Sails, Meteo…
As an IT professional, you may already appreciate the difficulty of staying relevant in an ever-changing sector. New technologies and advanced ways of doing things are trends that will not slow down in the future — in fact, they may speed up.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month