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 loop in python
while True:
print("Running")
#<infinite>: "Running" untill you press "ctrl + c" in termenal
infinite while python
#infinite While on Python
while True:
print('Hello World!')
python while continue
## When the program execution reaches a continue statement,
## the program execution immediately jumps back to the start
## of the loop.
while True:
print('Who are you?')
name = input()
if name != 'Joe':
continue
print('Hello, Joe. What is the password? (It is a fish.)')
password = input()
if password == 'swordfish':
break
print('Access granted.')
python exit loop iteration
alphabet = ['a' , 'b' , 'c' , 'd' ]
for letter in alphabet:
if letter == 'b' :
continue
#continues to next iteration
print( letter )
for letter in alphabet:
if letter == 'b' :
break
#terminates current loop
print( letter )
for letter in alphabet:
if letter == 'b' :
pass
#does nothing
print( letter )
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