Login program

194 Views
class Login:
    error = None
    def __init__(self, uid, passw):
        self.uid = "abc"
        self.passw = "123"
        Login.error = "Enter a valid user id and password"
        
    def authenticate(self):
        if (self.uid == logid and self.passw == logpass):
            print ("Login successful")
        else:
            print (Login.error)
            
log = Login("", "")
logid = input("Enter your user ID: ")
logpass = input("Enter your password: ")

log.authenticate()

I hope you realize this is a prime example of a bad login system. It's a fairly safe bet the data is in the clear.

Never teach this old method ever again.