如果我有類如下:embeding類財產清單,並調用它的價值觀
class theater:
def __init__(self):
self.__seatMatrix=[10]*5
self.__seats=seating[0]
self.__rows=len(seating)
我如何能實現一個get/setter方法來更新值的席位? 這個想法是,座位= [10] * 5,5排,10個座位。 整個週末我都在爲此轉過頭。 當我嘗試:
def getseats(self):
self.__seats
它不返回任何東西。
/Andy