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

제목2022_1학기 00분반 기출4번 질문있습니다.2024-01-07 19:58
작성자
첨부파일00-CLASS.pdf (97.3KB)
    def getCustomerIDByName(self, Name):
        new = {}
        for ID, name in self.customer.items():
            if name in new:
                new[name].append(ID)
                continue
            else:
                new[name] = ID
                continue
        ID_list = list(new[Name])
        found_dic = {}
        for i in ID_list:
            found_dic[i] = Name

        return found_dic

함수를 이렇게 작성하였는데 자꾸 new[name].append(ID)를 실행하면 for문이 다 돌지도 않았는데 함수가
종료가 됩니다. 왜그런지 알고싶습니다.
댓글