1.

Write a program to input username and password and to check whether the given username and password are correct or not.

Answer»

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”



Discussion

No Comment Found