An if statement is run once if its condition evaluates to True,
and never if it evaluates to False.
A while statement is similar, except
that it can be run more than once. The statements inside it are repeatedly
executed, as long as the condition holds. Once it evaluates to False, the next
section of code is executed.
The best way to learn new things is to take a practical approach of the things you want to learn. Here is a fragment of code that demonstrates the use of the while statement statement in Python:
The best way to learn new things is to take a practical approach of the things you want to learn. Here is a fragment of code that demonstrates the use of the while statement statement in Python:
Æ’ python command
k = 1
while k <=3:
print(k)
k = k + 1
print("Big Data with
Python!")
√ output
1
2
3
Big Data with Python!
Sign up here with your email
ConversionConversion EmoticonEmoticon