class Post:
def init(self, text):
self.text = text
self.likes = 0
def show(self):
print(f"{self.text} - {self.likes}")
def like(self):
self.likes += 1
posts = [
Post(“Hello”),
Post(“Hi”),
]
posts[0].likes += 1
posts[0].like()
for post in posts:
post.show()