def solution(num1, num2):
answer = int(num1).__floordiv__(num2)
return print(answer)
# 연산자 메소드
# __add__(self, other) : +
# __sub__(self, other) : -
# __mul__(self, other) : *
# __truediv__(self, other) : /
# __floordiv__(self, other) : //
# __mod__(self, other) : %
# __pow__(self, other[, modulo]) : **
# __lshift__(self, other) : <<
# __rshift__(self, other) : >>
ref.
https://andamiro25.tistory.com/50
[파이썬]연산자 오버로딩과 특수메소드, Rational 클래스(유리수)
8.5 연산자 오버로딩과 특수 메소드(Operator Overloading and Special Methods) * 오버로딩(overloading)과 오버라이딩(overriding) 개념을 간단하게나마 숙지하고 게시물을 봐주세요. 오버로딩(overloading) : 메소드
andamiro25.tistory.com
'Computer Science > 파이썬' 카테고리의 다른 글
[Python] pandas .tsv 파일 불러오기 - header 생성 및 추가 (0) | 2021.10.17 |
---|---|
파이썬에서 시간 측정하기 (0) | 2021.10.06 |
[Python] CLI로 사용하기 Terminal, git bash, Command line (0) | 2021.07.29 |
[Python] 파이썬에서 Github 사용하기 (ft.잔디농사를하자git commit) (0) | 2021.07.29 |
[Python] Conda 가상환경만들기 (+ 패키지 확인하기 저장하기 설치하기 requirements.txt) (0) | 2021.07.29 |