Nov-19-2019, 02:40 AM
(This post was last modified: Nov-19-2019, 02:41 AM by scratchmyhead.)
I am writing a python program exactly the way my course instructor has and when I try to run on my end, I get the following error: AttributeError: 'TagCloud' object has no attribute 'tags'
Below is the code:
Below is the code:
class TagCloud:
def __int__(self):
self.tags = {}
def add(self, tag):
self.tags[tag] = self.tags.get(tag, 0) + 1
cloud = TagCloud()
cloud.add("Python")
cloud.add("Python")
cloud.add("Python")
print(cloud.tags)What am I doing wrong?
