Answers for "how to start a while loop again in python"

4

infinite while python

#infinite While on Python

while True:
  print('Hello World!')
Posted by: Guest on May-19-2020
4

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 )
Posted by: Guest on April-06-2020
1

while loop python

# While loop counting to 10 in 2's

i = 2

while i <= 10:  # While i is less than or equal 10, it will add 2
  print(i)
  i = i + 2
Posted by: Guest on March-16-2021

Code answers related to "how to start a while loop again in python"

Python Answers by Framework

Browse Popular Code Answers by Language