classes 2

[Python:파이썬:기초] 17. 클래스 상속, 메소드 오버라이딩, super 함수 예제-Class Inheritance, Method Overriding , super function examples

[Python:파이썬:기초] 17. 클래스 상속, 다중 상속, 메소드 오버라이딩, super 함수 예제- Class Inheritance, Method Overriding , super function examples 안녕하세요 JollyTree입니다 (•̀ᴗ•́)و 클래스를 지원하는 파이썬도 클래스 상속(Inheritance)을 지원합니다. 클래스가 베이스(부모) 클래스로부터 상속받기 위해서는 클래스 이름 뒤에 괄호를 이용하여 상속받을 클래스의 이름을 입력합니다. class 클래스이름(베이스클래스): 코드 ... 일반적으로 클래스의 상속은 파생(자식) 클래스 기능을 확장시킬 때 사용합니다. 예제에서 footballPlayer과 computerEnginner 클래스는 Person 클래스를 상속하므로 Pe..

[Python:파이썬:기초] 16. 클래스와 객체(Classes, Objects) 생성하기

[Python:파이썬:기초] 16. 클래스와 객체(Classes, Objects) 생성하기 안녕하세요 JollyTree입니다 (•̀ᴗ•́)و 파이썬은 객체지향 언어(Object Oriented Programming Language)입니다. 그래서 클래스를 지원하며 클래스를 이용하여 객체(Object)를 생성할 수 있어요. 다음 클래스의 기본 구조로 클래스는 기본적으로 변수와 메소드(함수)를 포함해요. class 클래스명: 클래스 변수 ... def __init__(self, 파라미터): #메소드(함수) self.변수 = 파라미터 코드1 ... def 메소드명: 코드2 ... 클래스는 객체지향 프로그래밍 언어의 기본적인 사용자 정의 자료형(user defined data type)이며 같은 종류의 어떤 문..