Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. inp = input().split(', ')
  2. var = ''
  3. while True:
  4. command = input().split()
  5. if command[0] == 'Report':
  6. break
  7. if command[0] == 'Blacklist':
  8. if command[1] in inp:
  9. for i in range(len(inp)):
  10. if command[1] == inp[i]:
  11. inp[i] = 'Blacklisted'
  12. print(f'{command[1]} was blacklisted.')
  13. break
  14. else:
  15. print(f'{command[1]} was not found.')
  16. elif command[0] == 'Error':
  17. var = ''
  18. d = int(command[1])
  19. if 0 <= d <= len(inp) - 1:
  20. if inp[d] == 'Blacklisted' or inp[d] == 'Lost':
  21. continue
  22. else:
  23. var = inp[d]
  24. inp[d] = 'Lost'
  25. print(f'{var} was lost due to an error.')
  26. elif command[0] == 'Change':
  27. d = int(command[1])
  28. if 0 <= d <= len(inp) - 1:
  29. print(f'{inp[d]} changed his username to {command[2]}.')
  30. inp[d] = command[2]
  31. print(f"Blacklisted names: {inp.count('Blacklisted')}")
  32. print(f"Lost names: {inp.count('Lost')}")
  33. print(*inp, sep=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement