Viewers: in countries Watching now:
Due to its power, simplicity, and complete object model, Python has become the scripting language of choice for many large organizations, including Google, Yahoo, and IBM. In Python 3 Essential Training, Bill Weinman demonstrates how to use Python 3 to create well-designed scripts and maintain existing projects. This course covers the basics of the language syntax and usage, as well as advanced features such as objects, generators, and exceptions. Example projects include a normalized database interface and a complete working CRUD application. Exercise files accompany the course.
The simplest form of a loop in Python is the while loop. So, let's make a working copy of while.py, while-working.py, and we'll go ahead and open our working copy there. The while loop is controlled with the while keyword, which we can see here, and then there is an expression. So, the expression gets evaluated, and if the expression is true, then the code inside the loop, the suite, is executed. After that code is executed, the expression is evaluated again, and if it's still true, the code gets executed again.
This continues until the expression is evaluated as false, and then the execution begins after the while loop. So, let's go ahead and run this, and there is our Fibonacci series. So, this expression is b<50, so as long as the result there is <50, the while loop will continue. So, if I were to increase this to say 150, save that, and run it, then we get a few more numbers out there in the Fibonacci series.
So, while is the simplest form of loop in Python, and you can see all it does is it evaluates this expression. As long as the expression is true, it executes the code in the while loop, and as soon as the expression is not true, the loop ends. So, that's the while loop in Python.
Find answers to the most frequently asked questions about Python 3 Essential Training .
Here are the FAQs that matched your search "" :
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.