Skip to content

How to make a breakable loop in Python?

while True: # This calls for an infinite loop
    print("Hello, World") 
    # Stuff that is under this loop will go on for forever.
    # Unstead of "True" you can insert anything -
    # that you want just like using an "if". 
    #It just like "if" but it goes on forever. For example:
x=3 # or anything like input....
while x+3==6:
  print("Hello, World")
See also  Python code snippet - How to fix unexpected token?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.