while loops in python 3 part-5

Опубликовано: 01 Январь 2018
на канале: 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!


Смотрите видео while loops in python 3 part-5 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Cook The Code 01 Январь 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 8 раз и оно понравилось 0 людям.