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
@property
def likes(self):
return self._likes
posts = [
Post(“Hello”),
Post(“Hi”),
]
posts[0].likes = 100
print(posts[0].likes)