1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Allisa [31]
2 years ago
14

This was the template given for my assignment: class Login:

Computers and Technology
1 answer:
mars1129 [50]2 years ago
6 0

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.

<h3>Writing code in python:</h3>

<em>class Login:</em>

<em> def __init__(self):</em>

<em>  self.login_name = 'none'</em>

<em>  self.login_password = 'none'</em>

<em> def check_credentials(self, user_login, user_passwd):</em>

<em>  simlogin = 'Test'</em>

<em>  simpass = 'test1234'</em>

<em>  if user_login == simlogin and user_passwd == simpass:</em>

<em>   print("Successful login!")</em>

<em>   return True</em>

<em>  elif user_login == simlogin and user_passwd != simpass:</em>

<em>   print("Login name is correct, incorrect password!")</em>

<em>   return False</em>

<em>  elif user_login != simlogin and user_passwd == simpass:</em>

<em>   print("Login name incorrect, password accepted!")</em>

<em>   return False</em>

<em>  elif user_login != simlogin and user_passwd != simpass:</em>

<em>   print("Unsuccessful login attempt!")</em>

<em>   return False</em>

<em>if __name__ == "__main__":</em>

<em> ob = Login()</em>

<em> timeout = 5</em>

<em> login = input()</em>

<em> password = input()</em>

<em> valid_login = ob.check_credentials(login, password)</em>

<em> while True:</em>

<em>  if valid_login:</em>

<em>   break</em>

<em>  else:</em>

<em>   timeout = timeout - 1</em>

<em>   if timeout == 0:</em>

<em>    print("5 failed login attempts. No more login attempts.") </em>

<em>    break</em>

<em>   login = input()</em>

<em>   password = input()</em>

<em>   valid_login = ob.check_credentials(login, password)</em>

See more python at brainly.com/question/18502436

#SPJ1

You might be interested in
What Fortnite skin is more og?
gregori [183]
It’s elite agent i think ??
red nose raider comes out on christmas
7 0
3 years ago
Read 2 more answers
Jjgdg gegg tget t446v
lesya692 [45]
Hmmm yes, this seems reasonable
7 0
3 years ago
Read 2 more answers
Which of the following is a true statement about psychological tests administered by computers? computers make standardization e
Hitman42 [59]
Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
the true statement about psychological tests administered by computers is 
<span>most people find computerized tests to be difficult to understand. </span>
7 0
3 years ago
Traffic collisions are among the top killers of children in America.
Blababa [14]
Whats the question if its true or false, then true
8 0
3 years ago
The information provided in text aids can help us to understand a text’s content before we even read it.
dimaraw [331]
It is true that the information provided in text aids can help us to understand a text's content before we even read it.
These text aids will contain bits and pieces from the text, which will make us understand the overall message even before we actually get down to going through the text itself. I believe it is better to actually read the text, and try to understand it on your own, before going to these aids for help.
7 0
4 years ago
Other questions:
  • Cartoon Disney question: Snow White asks the dwarfs a question. 2 of them are lying and 3 can only say the truth. The continuati
    10·1 answer
  • The _____ of each phrase in a melody can be drawn with a curved line that follows the direction of the note progression.
    15·1 answer
  • A technician suspects a network card is not working. Which tool should the technician use to test the network card?
    8·1 answer
  • Which of the following solutions enables simultaneous digital transmission of voice, video, data, and other network services ove
    7·1 answer
  • In apersuasive message, opposing ideas should be:
    13·1 answer
  • List three ways security could be improved for taking the prepared deposit monies to the bank?​
    11·1 answer
  • Want to.learn about computers​
    9·1 answer
  • A final class can't be extended.<br><br> *True<br><br> *False
    9·1 answer
  • David is taking a test. To answer a question, he first covers up the answer choices. Next, he tries to answer the question. Then
    15·2 answers
  • What is an outcome in a game? Don't search google just give me an answer
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!