Ask 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 Correct! Sample Run 2 Enter the Password: Blaise Pascal Sample Output 2 Not Correct

+3
Answers (1)
  1. 16 May, 02:37
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers