Add py/Loops/task3.py
This commit is contained in:
parent
544942090a
commit
be237eb38c
1 changed files with 9 additions and 0 deletions
9
py/Loops/task3.py
Normal file
9
py/Loops/task3.py
Normal 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
|
Loading…
Add table
Reference in a new issue