Jan-15-2020, 06:10 PM
In addition to too much indentation on your __str__() definition you are using format strings wrong. What you have now will always return the string literal "self.item". On line 31 you are returning self.item which is already a string so just return it, remove the f and the two double quotes:
def __str__(self): return self.itemAlso on line 351 you are not calling your Starter.list_items method, you are printing it. Should be:
def inventory(): Starter.list_items()While I applaud your attempt to make this game Object Oriented you must have realized that simply creating several classes with the exact same code probably isn't right. The whole point of OOP would be to make a base class called "Crate" with all the common functionality and then inheriting from it in more specific classes which should only contain the things that are different from the base class. Inheritance is the first "Pillar of OOP" and it makes coding games like this a lot easier so you need to understand how to use it.
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter