Notice
Recent Posts
Recent Comments
Link
목록상속 (1)
초보 개발자
24강 상속
[부모 클래스와 자식 클래스] class A와 class Z가 있고 Z가 A를 상속한다면(받음) A가 가지고 있는 메서드들을 가지고 오고, 또 새로운 메서드를 추가할 수도이 있다. A클래스 : 부모 클래스, 슈퍼 클래스, 상위클래스 Z클래스 : 자식 클래스, 서브 클래스, 하위 클래스 # father_son.py class Father: def run(self): print('so fast!') class Mother: def dive(self): print('so deep!') class Son(Father, Mother): def jump(self): print('so high!!') def main(): s = Son() s.run() s.jump() s.dive() main() father와 mo..
Python/윤성우 열혈 파이썬
2022. 1. 18. 11:00