Update py/Loops/task1.py
This commit is contained in:
parent
3132cf06c9
commit
dc95d94cc3
1 changed files with 0 additions and 0 deletions
|
@ -1,8 +0,0 @@
|
|||
# Infinite loop that prints "Hi" until the user enters "STOP"
|
||||
|
||||
while True: # This creates an infinite loop
|
||||
user_input = input("Hi\n") # Prints "Hi" and waits for user input
|
||||
|
||||
# Check if the user input (ignoring spaces and case) is "STOP"
|
||||
if user_input.strip().upper() == "STOP":
|
||||
break # Exit the loop if the condition is met
|
Loading…
Add table
Add a link
Reference in a new issue