Advertisement
horozov86

Rubber Duck Debuggers

Jun 5th, 2023 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | None | 0 0
  1. from collections import deque
  2.  
  3. time = deque(int(x) for x in input().split())
  4. tasks = [int(x) for x in input().split()]
  5.  
  6. dictionary = {
  7.     'Darth Vader Ducky': [],
  8.     'Thor Ducky': [],
  9.     'Big Blue Rubber Ducky': [],
  10.     'Small Yellow Rubber Ducky': []
  11. }
  12.  
  13. result = 0
  14. while time:
  15.     first_value_time =time.popleft()
  16.     last_value_tasks = tasks.pop()
  17.    
  18.    
  19.     result = first_value_time * last_value_tasks
  20.    
  21.     if 0 < result <= 60:
  22.        
  23.         dictionary['Darth Vader Ducky'].append(result)
  24.            
  25.     elif 61 <= result <= 120:
  26.         dictionary['Thor Ducky'].append(result)
  27.        
  28.     elif 121 <= result <= 180:
  29.         dictionary['Big Blue Rubber Ducky'].append(result)
  30.    
  31.     elif 181 <= result <= 240:
  32.         dictionary['Small Yellow Rubber Ducky'].append(result)
  33.    
  34.     elif result > 240:
  35.         time.append(first_value_time)
  36.         tasks.append(last_value_tasks - 2)
  37.        
  38.  
  39.    
  40. print(f"Congratulations, all tasks have been completed! Rubber ducks rewarded: ")
  41.  
  42. for ducky, value in dictionary.items():
  43.     print(f"{ducky}: {len(value)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement