Add py/Loops./task1.py

This commit is contained in:
Eduard Prigoana 2025-03-30 22:19:27 +03:00
parent d91b49ddcb
commit 3132cf06c9

8
py/Loops./task1.py Normal file
View file

@ -0,0 +1,8 @@
# 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