You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Calculator:
"""
간단한 계산기를 나타내는 클래스.
이 클래스는 기본적인 산술 연산(덧셈, 뺄셈, 곱셈, 나눗셈)을 제공
"""
def subtract(self, a: float, b: float) -> float:
"""
두 숫자의 차를 계산
Args:
a (float): 첫 번째 숫자.
b (float): 두 번째 숫자.
Returns:
float: 두 숫자의 차.
"""
return a - b
2. 주석 작성:
한 줄 주석:
코드와 주석 사이 최소 두 칸 띄우고 # 사용.
여러 줄 주석:
최대한 피하되 논리적 구조가 연속되는 if-else 와 같은 구조에서 기능의 시작코드 바로 윗 줄에서
여러줄의 설명을 한번에 끝냄
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
1. 함수 및 클래스 Docstring:
2. 주석 작성:
코드와 주석 사이 최소 두 칸 띄우고
#
사용.최대한 피하되 논리적 구조가 연속되는 if-else 와 같은 구조에서 기능의 시작코드 바로 윗 줄에서
여러줄의 설명을 한번에 끝냄
3. 네이밍 규칙:
소문자 + 밑줄(
my_variable
).대문자 + 밑줄(
MY_CONSTANT
).카멜케이스(
MyClass
).소문자 + 밑줄(
my_function
).4. 클래스, 함수 간에 띄어쓰기
두 줄
한 줄
Beta Was this translation helpful? Give feedback.
All reactions