To create login program in python
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()
rproffitt 2,662 "Nothing to see here." Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.