Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. hours_each_task_take = list(map(lambda i: int(i), input().split()))
  2. command = input()
  3.  
  4. completed_c = 0
  5. incom_c = 0
  6. dropped_c = 0
  7.  
  8. while True:
  9. if command == 'End':
  10. break
  11. new_com = command.split()
  12. if new_com[0] == 'Complete':
  13. if 0 <= int(new_com[1]) < len(hours_each_task_take):
  14. hours_each_task_take[int(new_com[1])] = 0
  15. elif new_com[0] == 'Change':
  16. if 0 <= int(new_com[1]) < len(hours_each_task_take):
  17. hours_each_task_take[int(new_com[1])] = int(new_com[2])
  18. elif new_com[0] == 'Drop':
  19. if 0 <= int(new_com[1]) < len(hours_each_task_take):
  20. hours_each_task_take[int(new_com[1])] = -1
  21. elif new_com[0] == 'Count' and new_com[1] == 'Completed':
  22. for el in hours_each_task_take:
  23. if el == 0:
  24. completed_c += 1
  25. print(completed_c)
  26. elif new_com[0] == 'Count' and new_com[1] == 'Incomplete':
  27. for el in hours_each_task_take:
  28. if el > 0:
  29. incom_c += 1
  30. print(incom_c)
  31.  
  32. elif new_com[0] == 'Count' and new_com[1] == 'Dropped':
  33. for el in hours_each_task_take:
  34. if el < 0:
  35. dropped_c += 1
  36. print(dropped_c)
  37.  
  38. command = input()
  39.  
  40. for el in hours_each_task_take:
  41. if el > 0:
  42. print(el, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement