#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http 제목2020 1학기 기출 질문드립니다.2021-12-03 01:21작성자dd첨부파일캡처.PNG (84.6KB)첨부한 사진의 문제입니다(A)class RemoteControl: __enabledChannelList = list() def powerOnRemoteControl(clist): RemoteControl.__enabledChannelList = clist RemoteControl.recentNum = clist[0][0] RemoteControl.recentChannel = clist[0][1] return len(clist)1번까지를 이렇게 짰는데, 채점이 진행될 때 입력파라미터가 어떻게 주어질지 모르겠습니다.위 같이 짠 상태에서 RemoteControl.powerOnRemoteControl([[6,"SBS"],[7,"KBS2"],[9,"KBS1"],[11,"MBC"]])셀창에 위 문장을 입력하면 정확히 입력이 되는데,(B)class RemoteControl(): def __init__(self): self.nowChannel_index = 0 self.__enabledChannelList = [] self.enabledNumberList= [] self.nowChannel = [] self.blockChannelList = [] self.favorlist = {} def powerOnRemoteControl(self, clist): self.__enabledChannelList = clist self.nowChannel = clist[0] for i in range(len(clist)): self.enabledNumberList.append(clist[i][0]) return len(clist)이렇게 짠 상태에서 위의 RemoteControl.powerOnRemoteControl([[6,"SBS"],[7,"KBS2"],[9,"KBS1"],[11,"MBC"]])을 입력하면 오류가납니다.채점이 진행될 때, 예를 들어Remote = RemoteControl() 로 객체를 먼저 만들고 Remote.powerOnRemoteControl([[6,"SBS"],[7,"KBS2"],[9,"KBS1"],[11,"MBC"]]) 처럼 메소드가 실행이 되는건지,아니면 RemoteControl.powerOnRemoteControl([[6,"SBS"],[7,"KBS2"],[9,"KBS1"],[11,"MBC"]]) 이 코드가 실행이 되게 짜는걸까요?첫번째 코드 (A)에 Remote = RemoteControl() Remote.powerOnRemoteControl([[6,"SBS"],[7,"KBS2"],[9,"KBS1"],[11,"MBC"]]) 를 대입하면 또 오류가납니다.첫번째 코드(A)가 정답인가요? 두번째 코드(B)가 정답인가요?출제 의도와 채점 기준이 궁금해서 질문드립니다 목록수정삭제답변글쓰기 댓글 [0] 댓글작성자(*)비밀번호(*)내용(*) 댓글 등록 더보기이전2020-2학기 기출문제car2021-12-03다음20년 기출문제 질문 드립니다.1232021-12-02 Powered by MangBoard | 워드프레스 쇼핑몰 망보드