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