From 3132cf06c920c1c3d128c24ceba08b5b93bc1750 Mon Sep 17 00:00:00 2001 From: EduardPrigoana Date: Sun, 30 Mar 2025 22:19:27 +0300 Subject: [PATCH] Add py/Loops./task1.py --- py/Loops./task1.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 py/Loops./task1.py diff --git a/py/Loops./task1.py b/py/Loops./task1.py new file mode 100644 index 0000000..876fee6 --- /dev/null +++ b/py/Loops./task1.py @@ -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 \ No newline at end of file