Ask Question
23 October, 07:10

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

+3
Answers (1)
  1. 23 October, 08:26
    0
    a1="Ada Lovelace"

    a2 = input ("Enter Password: ")

    def checkpassword (a2):

    if a2 = = a1:

    print ("Correct Password")

    else:

    print ("Wrong Password")

    return 0

    Explanation:

    The string as password is given. Now we ask the user to input the password, and this is compared to the original password. If the passwords match, print password matched, or else print wrong password.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Test if a password entered is correct. The secret phrase is Ada Lovelace. Sample Run 1 Enter the Password: Ada Lovelace Sample Output 1 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers