Inventory (3 points) ==================== The pasta company stores their produced pasta types in a warehouse and manages the warehouse inventory with a registration file. Every movement in the warehouse is registered in one line, which contains the following information: a tag indicating if the package was produced (IN) or if it was sold away (OUT), the name of the pasta type and the weight of the package in kilograms, separated by a space. For example, you can download file :download:`registration.txt` with the following content, that is used in the first test: .. literalinclude:: registration.txt :language: text Write a **modifier** function :py:func:`inventory` that takes three parameters. The first one is a dictionary containing as key the name of each produced pasta type (:py:class:`str`) and as value the corresponding stock in kg (:py:class:`int`) at the beginning of the day. The next two parameters are names of files (:py:class:`str`), one for the given registration file and one for the sold out output file that must be created. Automatize the inventory at the end of the day based on the movements provided in the registration file, by **modifying** the provided dictionary in the following way. For ``IN`` registration lines: add the amount of kg to the corresponding pasta type stock; for ``OUT`` registration lines: subtract the amount of kg to the corresponding stock. There can be negative numbers. Moreover, all pasta type names with a stock less than or equal to 0 kg at the end of the day must be written in the sold out output file (in any order and one per line). This file must be created always, even if it empty. Example based on the registration file given above: .. literalinclude:: test-inventory.txt :language: python :lines: 3-12 We can see how the stock dictionary has been modified. Moreover, a file named ``soldout.txt`` has been created, with the following content: .. literalinclude:: soldout.txt :language: text Save this function to file ``p2.py``. .. note:: More tests are provided in file :download:`test-inventory.txt`.