The while statement consists of
Python keeps evaluating the test at the top and executing the statements nested in the loop body until the test returns a false value:
while test: # Loop test statements # Loop body else: # Optional else statements # Run if didn't exit loop with break
The following code outputs the message until you press control c.
while True: print('Type Ctrl-C to stop me!')