Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hours_each_task_take = list(map(lambda i: int(i), input().split()))
- command = input()
- completed_c = 0
- incom_c = 0
- dropped_c = 0
- while True:
- if command == 'End':
- break
- new_com = command.split()
- if new_com[0] == 'Complete':
- if 0 <= int(new_com[1]) < len(hours_each_task_take):
- hours_each_task_take[int(new_com[1])] = 0
- elif new_com[0] == 'Change':
- if 0 <= int(new_com[1]) < len(hours_each_task_take):
- hours_each_task_take[int(new_com[1])] = int(new_com[2])
- elif new_com[0] == 'Drop':
- if 0 <= int(new_com[1]) < len(hours_each_task_take):
- hours_each_task_take[int(new_com[1])] = -1
- elif new_com[0] == 'Count' and new_com[1] == 'Completed':
- for el in hours_each_task_take:
- if el == 0:
- completed_c += 1
- print(completed_c)
- elif new_com[0] == 'Count' and new_com[1] == 'Incomplete':
- for el in hours_each_task_take:
- if el > 0:
- incom_c += 1
- print(incom_c)
- elif new_com[0] == 'Count' and new_com[1] == 'Dropped':
- for el in hours_each_task_take:
- if el < 0:
- dropped_c += 1
- print(dropped_c)
- command = input()
- for el in hours_each_task_take:
- if el > 0:
- print(el, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement