aneliabogeva

User Logins

Jul 3rd, 2019
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. command = input()
  2. name_dict = {}
  3. counter = 0
  4.  
  5. while not command == 'login':
  6. data = [item for item in command.split(" -> ")]
  7. name_dict[data[0]] = data[1]
  8. command = input()
  9.  
  10. command=input()
  11.  
  12. while not command == "end":
  13. #data_2 = [item for item in command.split(" -> ")]
  14. key, value = command.split(" -> ")
  15. if key in name_dict:
  16. if value == name_dict[key]:
  17. print(f"{key}: logged in successfully")
  18. else:
  19. print(f"{key}: login failed")
  20. counter +=1
  21. else:
  22. print(f"{key}: login failed")
  23. counter += 1
  24. command = input()
  25.  
  26. print(f"unsuccessful login attempts: {counter}")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×