So, I'm making a text based game to learn the python language. and I can't get the return function working...
Here is my code;
class Weapon:
def __str__(self):
return self.name
class WoodenStaff(Weapon):
def __init__(self):
self.name = "Wooden Staff"
self.description = "Basic Staff"
self.damage = 5
inventory = [WoodenStaff()]
print (inventory)
After I run this I got:
[<__main__.WoodenStaff object at 0x000001E9F192CAC8>]