Add py/Loops/task3.py

This commit is contained in:
Eduard Prigoana 2025-03-30 22:22:31 +03:00
parent 544942090a
commit be237eb38c

9
py/Loops/task3.py Normal file
View file

@ -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