Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def stock_availability(inventory, to_do, *args):
- cupcakes = [el for el in inventory]
- if to_do == "delivery":
- for el in args:
- cupcakes.append(el)
- elif to_do == "sell":
- if args:
- if type(*args) == int:
- cupcakes = []
- else:
- for el in cupcakes:
- if el == args:
- cupcakes.remove(el)
- else:
- cupcakes = cupcakes[1::]
- return cupcakes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement