Python Attribute Error: type object has no attribute

You are not creating an instance, but instead referencing the class Goblin itself as indicated by the error:

AttributeError: type object ‘Goblin’ has no attribute ‘color’

Change your line to Azog = Goblin()

Leave a Comment