Mar-01-2018, 02:01 AM
I'm pretty new to python & programming in general. I cant figure out how to print gold as a string.
class Item: def __init__(self, name, description, value): self.name = name self.description = description self.value = value def __str__(self): return "{}\n=====\n{}\nValue: {}\n".format(self.name, self.description, self.value) class Gold(Item): def __init__(self, amt): self.amt = amt super().__init__(name='Gold', description='A Round Coin', value=self.amt) print(Gold)
Output: <class '__main__.Gold'>