cshw/py/IfElseStatements/challenge2.py

10 lines
No EOL
383 B
Python

# Question: Change your password program you created earlier. If they enter “letmein”, display the message “access granted” otherwise display “access denied”.
# Ask the user to enter the password
password = input("Enter your password: ").strip()
# Check if the password is "letmein"
if password == "letmein":
print("Access granted")
else:
print("Access denied")