Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input()
- name_dict = {}
- counter = 0
- while not command == 'login':
- data = [item for item in command.split(" -> ")]
- name_dict[data[0]] = data[1]
- command = input()
- command=input()
- while not command == "end":
- #data_2 = [item for item in command.split(" -> ")]
- key, value = command.split(" -> ")
- if key in name_dict:
- if value == name_dict[key]:
- print(f"{key}: logged in successfully")
- else:
- print(f"{key}: login failed")
- counter +=1
- else:
- print(f"{key}: login failed")
- counter += 1
- command = input()
- print(f"unsuccessful login attempts: {counter}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement