From be237eb38c616dfbec6729ac2ab13d282dea6328 Mon Sep 17 00:00:00 2001 From: EduardPrigoana Date: Sun, 30 Mar 2025 22:22:31 +0300 Subject: [PATCH] Add py/Loops/task3.py --- py/Loops/task3.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 py/Loops/task3.py diff --git a/py/Loops/task3.py b/py/Loops/task3.py new file mode 100644 index 0000000..aa8eb82 --- /dev/null +++ b/py/Loops/task3.py @@ -0,0 +1,9 @@ +# Keep asking for a passcode until the correct one is entered +while True: + passcode = input("Enter the passcode: ") # Prompt the user for input + + if passcode == "1234": # Check if the input matches the correct passcode + print("Access granted!") # Confirm access + break # Exit the loop + else: + print("Incorrect passcode. Try again.") # Notify the user if incorrect \ No newline at end of file