sibinasto

7. Easter Gifts

Jan 27th, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. initial_input = input()
  2. gifts = initial_input.split()
  3.  
  4. command = input()
  5.  
  6. while command != "No Money":
  7.     if "OutOfStock" in command:
  8.         gifts = ["None" if x == command.split()[1] else x for x in gifts]
  9.     if "Required" in command and -1 < int(command.split()[2]) < len(gifts):
  10.         gifts[int(command.split()[2])] = command.split()[1]
  11.     if "JustInCase" in command:
  12.         gifts[len(gifts)-1] = command.split()[1]
  13.     command = input()
  14.  
  15. for gift in gifts:
  16.     if gift != "None":
  17.         print(gift, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment