Westonci.ca offers quick and accurate answers to your questions. Join our community and get the insights you need today. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.
Sagot :
Using the code in python it is possible to use the code given in the statement it is possible to make the change so that it fits with all topics.
Writing code in python:
class Login:
def __init__(self):
self.login_name = 'none'
self.login_password = 'none'
def check_credentials(self, user_login, user_passwd):
simlogin = 'Test'
simpass = 'test1234'
if user_login == simlogin and user_passwd == simpass:
print("Successful login!")
return True
elif user_login == simlogin and user_passwd != simpass:
print("Login name is correct, incorrect password!")
return False
elif user_login != simlogin and user_passwd == simpass:
print("Login name incorrect, password accepted!")
return False
elif user_login != simlogin and user_passwd != simpass:
print("Unsuccessful login attempt!")
return False
if __name__ == "__main__":
ob = Login()
timeout = 5
login = input()
password = input()
valid_login = ob.check_credentials(login, password)
while True:
if valid_login:
break
else:
timeout = timeout - 1
if timeout == 0:
print("5 failed login attempts. No more login attempts.")
break
login = input()
password = input()
valid_login = ob.check_credentials(login, password)
See more python at brainly.com/question/18502436
#SPJ1
Thank you for trusting us with your questions. We're here to help you find accurate answers quickly and efficiently. We hope our answers were useful. Return anytime for more information and answers to any other questions you have. Stay curious and keep coming back to Westonci.ca for answers to all your burning questions.