#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http 제목2020-1학기 기출문제 질문2022-06-14 16:20작성자수강생22class RemoteControl: ''' powerOnRemoteControl, gotoChannel, nextChannel, previousChannel, blockChannel, unblockChannel, powerOffRemoteControl, favorChannel, aiNextChannel ''' __enabledChannelList = [[6,"SBS"],[7,"KBS"],[9,"KBS1"],[11,"MBC"]] def __init__(self): self.__enabledChannelList = [] self.channel_count = [] def powerOnRemoteControl(self, channel_list): self.__enabledChannelList = channel_list self.nowChannel = channel_list[0] for i in range(len(channel_list)): self.channel_count.append(self.__enabledChannelList[i][0]) return len(channel_list)R = RemoteControlprint(R.powerOnRemoteControl(channel_list=[[6,"SBS"],[7,"KBS"],[9,"KBS1"],[11,"MBC"]]))예외가 발생했습니다. TypeErrorpowerOnRemoteControl() missing 1 required positional argument: 'self' File "C:\Users\small\OneDrive\바탕 화면\웹파이썬\기말고사\2020-1학기 기출 연습.py", line 35, in <module> print(R.powerOnRemoteControl(channel_list=[[6,"SBS"],[7,"KBS"],[9,"KBS1"],[11,"MBC"]]))위 코드가 문제 조건에 맞는 지에 판단하기 위해 class 코드 밑에 print(R.powerOnRemoteControl(~))을 통해 출력해보았습니다.하지만 self 의 값이 없어서 위와 같은 오류가 발생했습니다. 혹시 self는 인스턴스로 원래 값을 주지 않아도 실행이 되야 하는 것 아닌가요?답변 감사합니다. 목록수정삭제답변글쓰기 댓글 [0] 댓글작성자(*)비밀번호(*)내용(*) 댓글 등록 더보기이전[re]2020겨울계절 기출질문입니다.수업도우미 인바다2022-06-15다음[re]2020-1학기 기출문제 질문수업도우미 박재훈2022-06-14 Powered by MangBoard | 워드프레스 쇼핑몰 망보드