7. Easter Gifts
Здравейте, имам проблем с задача 07.Easter Gifts от Exercise-a на List Basics. Всичко ми изглежда наред, само че последните 3 теста гърмят.
Условието на задачата е:
Моето решение:
Здравейте, имам проблем с задача 07.Easter Gifts от Exercise-a на List Basics. Всичко ми изглежда наред, само че последните 3 теста гърмят.
Условието на задачата е:
Моето решение:
gifts = input().split()
command = input()
while not command == "No Money":
command = command.split()
if "OutOfStock" in command:
for i in range(len(gifts)):
if command[1] in gifts[i]:
gifts[i] = "None"
elif "Required" in command:
for i in range(len(gifts)):
if i == int(command[2]):
gifts[i] = command[1]
elif "JustInCase" in command:
gifts[-1] = command[1]
command = input()
while "None" in gifts:
gifts.remove("None")
for i in gifts:
print(i, end=" ")