how to write a while statement in python
myvariable = 10
while myvariable > 0:
print(myvariable)
myvariable -= 1
how to write a while statement in python
myvariable = 10
while myvariable > 0:
print(myvariable)
myvariable -= 1
while else python
target = 100
current = 0
while current != target:
current += 1
print(current)
#The while loop repeats the indented code while its condition is true
#(current IS NOT equal to target).
else:
print("Target Reached!")
#When the while loop condition is no longer true (current IS equal to target),
#the indented code under else: is ran.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us