Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- friends = input().split(", ")
- command = input().split()
- while not command[0] == "Report":
- if command[0] == "Blacklist":
- if command[1] in friends:
- for i in range(len(friends)):
- if friends[i] == command[1]:
- friends[i] = "Blacklisted"
- print(f"{command[1]} was blacklisted.")
- else:
- print(f"{command[1]} was not found.")
- elif command[0] == "Error":
- if 0 <= int(command[1]) < len(friends) and not friends[int(command[1])] == "Blacklisted" and not friends[int(command[1])] == "Lost":
- print(f"{friends[int(command[1])]} was lost due to an error.")
- friends[int(command[1])] = "Lost"
- elif command[0] == "Change":
- if 0 <= int(command[1]) < len(friends):
- print(f"{friends[int(command[1])]} changed his username to {command[2]}.")
- friends[int(command[1])] = command[2]
- command = input().split()
- 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