while loops in python 3 part-5

Published: 01 January 2018
on channel: Cook The Code
8
0

A while loop statement in Python programming language repeatedly executes a target statement as long as a given condition is true.

Syntax
The syntax of a while loop in Python programming language is −

while expression:
statement(s)
Here, statement(s) may be a single statement or a block of statements.

Example
#!/usr/bin/python

count = 0
while (count less then 9):
print 'The count is:', count
count = count + 1

print "Good bye!"

When the above code is executed, it produces the following result −

The count is: 0
The count is: 1
The count is: 2
The count is: 3
The count is: 4
The count is: 5
The count is: 6
The count is: 7
The count is: 8
Good bye!


Watch video while loops in python 3 part-5 online without registration, duration hours minute second in high quality. This video was added by user Cook The Code 01 January 2018, don't forget to share it with your friends and acquaintances, it has been viewed on our site 8 once and liked it 0 people.