Update inventory.py

code cleanup