파이썬 Class와 Object란? (예제로 알아보기, 내장함수 확인하기)


파이썬 Class와 Object란? (예제로 알아보기, 내장함수 확인하기)

python 에서 class와 object 를 설명할 때 붕어빵을 비유하여 설명을 많이 한다. Class는 붕어빵을 만드는 틀이고 Object는 틀에서 만들어진 붕어빵인 것이다. Class 는 변수와 함수로 구성된다. 예제를 통해 이해해보기 코드 >> class parent: def __init__(self, father, mother): self.pop = father self.mom = mother def description(self, no_ch): self.no_children = no_ch print("My father is ", self.pop) print("My mother is ", self.mom) print("I have ",self.no_children,"children") A_fam..


원문링크 : 파이썬 Class와 Object란? (예제로 알아보기, 내장함수 확인하기)