About the program
This Python program asks the user for a username and password and checks whether they match the valid values.
If they match, the message Correct is shown; otherwise Not Correct is printed.
Python code:
# Read the username and password from the user
username = input("Enter your username: ")
password = input("Enter your password: ")
# Check the credentials
if username == "Samanehvariom" and password == "123456":
print("Correct")
else:
print("Not Correct")Sample output:
Enter your username: Samanehvariom
Enter your password: 123456
CorrectHow it works:
- The username and password are read with input()
- The entered values are compared with the valid strings
- If both match exactly, Correct is printed
- Otherwise, Not Correct is shown