Advertisement
bl00dt3ars

friends

Jul 10th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. friends = input().split(", ")
  2. command = input().split()
  3.  
  4. while not command[0] == "Report":
  5.     if command[0] == "Blacklist":
  6.         if command[1] in friends:
  7.             for i in range(len(friends)):
  8.                 if friends[i] == command[1]:
  9.                     friends[i] = "Blacklisted"
  10.                     print(f"{command[1]} was blacklisted.")
  11.         else:
  12.             print(f"{command[1]} was not found.")
  13.     elif command[0] == "Error":
  14.         if 0 <= int(command[1]) < len(friends) and not friends[int(command[1])] == "Blacklisted" and not friends[int(command[1])] == "Lost":
  15.             print(f"{friends[int(command[1])]} was lost due to an error.")
  16.             friends[int(command[1])] = "Lost"
  17.     elif command[0] == "Change":
  18.         if 0 <= int(command[1]) < len(friends):
  19.             print(f"{friends[int(command[1])]} changed his username to {command[2]}.")
  20.             friends[int(command[1])] = command[2]
  21.     command = input().split()
  22.  
  23. print(f"Blacklisted names: {friends.count('Blacklisted')}")
  24. print(f"Lost names: {friends.count('Lost')}")
  25. print(" ".join(friends))
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement