In [2]:
''' 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)
https://www.tutorialspoint.com/python/python_while_loop.htm '''
Out[2]:
In [6]:
a=10
i=1
while (i<=10):
print(i , " My name is venkat")
print("vlrtraining")
i=i+1
print("thanks for programming")
In [7]:
a=10
i=1
while (False):
print(i , " My name is venkat")
print("vlrtraining")
i=i+1
print("thanks for programming")
In [8]:
a=20
i=1
while(i<=20):
print(i)
i=i+2
No comments:
Post a Comment