본문 바로가기
Programming/python

[python] 클래스 연습

by 그렉그의 2023. 3. 11.

python

1. class 

class Person:
def greeting(self):
print("hello")

클래스 사용 시,
james= Person()
class Person:
def greeting(self):
print("hello")


# 클래스 사용 시,
james = Person()

# 매서드 호출 시, 인스턴스를 통해 호출 함
james.greeting()

'Programming > python' 카테고리의 다른 글

[python] Pandas Series 기본 개념 정리  (0) 2023.03.23
[PY] pandas 기본  (0) 2023.03.23
[python] 리스트 연습  (0) 2023.03.08
[python] Day 28  (0) 2023.03.07
[python] Day 26  (0) 2023.03.05