#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목class에 관련하여 질문이 있습니다.2022-12-30 15:01
작성자
class RemoteControl :

    __enabledChannelList = []
   
    def __init__(self, nowchannel = None) :
        self.NowChannel = nowchannel

    def powerOnRemoteControl(self, userlist) :
        self.__enabledChannelList.append(userlist)
        self.Nowchannel = self.__enabledChannelList[0][0]
        return len(self.__enabledChannelList)

위의 코드 powerOnRemoteControl()함수를 보면 self.Nowchannel = self.__enabledChannelList[0][0]
라는 코드가 있는데 확인을 해보면 Nowchannel에 __enabledChannelList[0][0]이 저장이 되지 않습니다.
어떤 것이 문제인지 알 수 있겠습니까?
댓글