67.4k views
3 votes
Test if a password entered is correct. The secret phrase is “Amedeo Avogadro” (without the quotes).

Sample Run 1
Enter the password: Amedeo Avogadro
Sample Output 1
Correct!
Sample Run 2
Enter the password: Georg Cantor
Sample Output 2
Not Correct

i need the code to find the right answer please

User VyvIT
by
7.2k points

1 Answer

0 votes

Answer:

Here's a Python code snippet that will prompt the user to enter a password and then check if it matches the secret phrase "Amedeo Avogadro":

# Prompt user to enter password

password = input("Enter the password: ")

# Check if password is correct

if password == "Amedeo Avogadro":

print("Correct!")

else:

print("Not Correct")

Step-by-step explanation:

You can run this code in a Python environment or save it as a .py file and run it in the command line.

User Prakash Dahal
by
7.7k points