0
Q:

python while break loop

while <condition>:
  <run code here>
  
# for example,
i = 0
while True:
  i += 1
  # i will begin to count up to infinity
while i == -1:
  print("impossible!")
10
while <Condition>:
  <code>
  
  #example
  i = 10
  while i == 10:
    print("Hello World!")
2
## When 'break' is used in a while loop, it instantly leaves the loop
while True:
    print('Please type your name.')
    name = input()
    if name == 'your name':
        break
print('Thank you!')
4
a = 0
while a < 11:
  a += 1
  print(a)
0
while whatitis:
  #code goes here no comment
0

New to Communities?

Join the community