mmishanchyk

Untitled

Jun 17th, 2021
780
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def stock_availability(inventory, to_do, *args):
  2.     cupcakes = [el for el in inventory]
  3.  
  4.     if to_do == "delivery":
  5.         for el in args:
  6.             cupcakes.append(el)
  7.  
  8.     elif to_do == "sell":
  9.         if args:
  10.             if type(*args) == int:
  11.                   cupcakes = []
  12.  
  13.             else:
  14.                 for el in cupcakes:
  15.                     if el == args:
  16.                         cupcakes.remove(el)
  17.         else:
  18.             cupcakes = cupcakes[1::]
  19.  
  20.     return cupcakes
RAW Paste Data