116k views
14 votes
Test if a password entered is correct. The secret phrase is Ada Lovelace.

Sample Run 1
Enter the Password: Ada Lovelace
Sample Output 1
Correct!
Sample Run 2
Enter the Password: Blaise Pascal
Sample Output 2
Not Correct

for Python

1 Answer

6 votes

password = "Ada Lovelace"

if input("Enter the Password: ") == password:

print("Correct!")

else:

print("Not Correct")

I wrote my code in python 3.8. I hope this helps.

User Overthink
by
8.2k points