Advertisements
Advertisements
Question
Write a program to input username and password and to check whether the given username and password are correct or not.
Code Writing
Advertisements
Solution
Compare the entered username and password with the valid username and password.
username = input("Enter username: ")
password = input("Enter password: ")
if username == "admin" and password == "admin123":
print("Username and password are correct")
else:
print("Username or password is incorrect")shaalaa.com
Is there an error in this question or solution?
