ankit
0
Q:

python while

while (condition):
  doThis();
10
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

i = 1

while i < 6:

  print(i)

    if i == 3:
    break
  i += 1
 
6

i = 1

while i < 6:

  print(i)

  i += 1

 
4

i = 0

while i < 6:

    i += 1

  if i == 3:
    continue
  print(i)

 
3
while <Condition>:
  <code>
  
  #example
  i = 10
  while i == 10:
    print("Hello World!")
2
# while loop (python)
i = 0 

while i < 10:
  	i +=1 #or i = i + 1 
    print(i)
0
a = 0
while a < 11:
  a += 1
  print(a)
0
while expression:
    statement(s)
0
while whatitis:
  #code goes here no comment
0

New to Communities?

Join the community