Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- friends = input().split(', ')
- # blacklisted = 0
- # lost = 0
- input_command = input()
- while not input_command == "Report":
- args = input_command.split()
- command = args[0]
- if command == "Blacklist":
- name = args[1]
- if name in friends:
- for i in range(len(friends)):
- if friends[i] == name:
- friends[i] = "Blacklisted"
- print(f"{name} was blacklisted.")
- # blacklisted += 1
- else:
- print(f"{name} was not found.")
- elif command == "Error":
- index = int(args[1])
- name = friends[index]
- if 0 <= index < len(friends):
- if friends[index] != "Lost" and friends[index] != "Blacklisted":
- friends[index] = "Lost"
- print(f"{name} was lost due to an error.")
- # lost += 1
- elif command == "Change":
- index = int(args[1])
- new_name = args[2]
- if 0 <= index < len(friends) and friends[index] != "Lost" and friends[index] != "Blacklisted":
- print(f"{friends[index]} changed his username to {new_name}.")
- # current_username = friends[index]
- friends[index] = new_name
- # friends.insert(index, new_name)
- input_command = input()
- print(f"Blacklisted names: {friends.count('Blacklisted')}")
- print(f"Lost names: {friends.count('Lost')}")
- print(' '.join(friends))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement