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

제목default constructor2021-12-04 14:52
작성자

class MyClass :

def__init__(self, parameter=None) :

self.parameter = parameter


a = MyClass()

b = MyClass(1)


이런식으로 작성하면

객체 a는 default constructor로 생성된 객체이고,

객체 b는 입력 파라미터가 1개 있는 constructor로 생성된 객체이다


라고 말할 수 있을까요?

댓글
이전여름학기 기말고사 질문2021-12-05
다음20 겨울 문제 질문2021-12-04