Write a program to input username and password and to check whether the given username and password are correct or not.
Write a program to input username and password and to check whether the given username and password are correct or not.
4 views
2 Answers
import string
usemame= raw_input(“Enter username”)
password = raw_input(“Enter password”)
if cmp(username.strip(),“XXX”)== 0:
if cmp(password,”123”) == 0:
print “Login successful”
else:
print “Password Incorrect”
else:
print “Username Incorrect”
4 views
Answered
import string
usemame= raw_input(“Enter username”)
password = raw_input(“Enter password”)
if cmp(usemame.strip(),“XXX”)== 0:
if cmp(password,”123”) == 0:
print “Login successful”
else:
print “Password Incorrect”
else:
print “Username Incorrect”
4 views
Answered