Aug-19-2018, 04:51 PM
What I am trying to do is make a SIMPLE python inventory system but I am having trouble. Just so you know its not done yet. In the "if" statement part I want the user to choose which list to add a item to, but I don't want to do a "if" statement for each list, so I'm trying to find a way to where it just adds to the list that you type in to make it easier but I get a error message. I get a error though.
Error:Line 14: AttributeError: 'str' object has no attribute 'append'
print("Welcome to Inventory Managment, type 'help' if you need help" food = [] tools = [] electronics = [] books = [] furniture = [] command = input("What would you like to do?: ") if command == "add": cato = input("Where would you like to add?: ") item = input("What item would you like to add?: ") cato.append(item) print(food)