You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Here we will look into how to use one of the loops - while loop to generate desired outputs with certain condition
# Syntax: After while we pass the condition to be checked
t = 0
while t < 10:
t = t + 2
print(t)
# Also we can use an |else| stance with the while loop as if the condition don't satisfy and we need a last statement to be executed after the while loop is finished:
t = 0
while t < 10:
t = t + 2
print(t)
else:
print("loop finished")
# So above loop will work till the specified condition is satisfied hence will run about 5 times in this case