CMI KOREA PYTHON CMI KOREA H P EMAIL

  • Slides: 11
Download presentation
CMI KOREA PYTHON CMI KOREA 연구원 H. P E-MAIL 기업부설 연구소 정재윤 010 -2219

CMI KOREA PYTHON CMI KOREA 연구원 H. P E-MAIL 기업부설 연구소 정재윤 010 -2219 -3046 wjdwodbs 82@naver. com

3. Python 클래스 self >>>class Person: >>> def say_hi(self): >>> print('Hello, how are you?

3. Python 클래스 self >>>class Person: >>> def say_hi(self): >>> print('Hello, how are you? ') >>> p = Person() >>> p. say_hi() Hello, how are you?

3. Python 클래스 메서드(Method) 연산자(Operator) 사용 예 __add__(self, other) + (이항) A + B,

3. Python 클래스 메서드(Method) 연산자(Operator) 사용 예 __add__(self, other) + (이항) A + B, A += B _pos__(self) + (단항) +A __sub__(self, other) - (이항) A - B, A -= B __neg__(self) - (단항) -A __mul__(self, other) * A * B, A *= B __truediv__(self, other) / A / B, A /= B __floordiv__(self, other) // A // B, A //= B __mod__(self, other) % A % B, A %= B __pow__(self, other) pow(), ** pow(A, B), A ** B __lshift__(self, other) << A << B, A <<= B __rshift__(self, other) >> A >> B, A >>= B __and__(self, other) & A & B, A &= B __xor__(self, other) ^ A ^ B, A ^= B __or__(self, other) | A | B, A |= B __invert__(self) ~ ~A __abs__(self) abs(A)

Next Preview Python 예외처리 Python 파일 입/출력 Python lambda Python 모듈 Python 내장함수

Next Preview Python 예외처리 Python 파일 입/출력 Python lambda Python 모듈 Python 내장함수