샘플 포스트
수식
The Pythagorean theorem states that in a right-angled triangle, the square of the length of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the lengths of the other two sides. In LaTeX notation, it can be expressed as: $(x^2 + y^2 = z^2)$ Where $x$ and $y$ are the lengths of the two sides that meet at the right angle, and $z$ is the length of the hypotenuse.
코드
# 은행 계좌 클래스
class BankAccount:
def __init__(self, name, balance=0):
self.name = name
self.balance = balance
def deposit(self, amount):
self.balance += amount
print(f"입금 완료: 현재 잔액은 {self.balance}원 입니다.")
def withdraw(self, amount):
if self.balance >= amount:
self.balance -= amount
print(f"출금 완료: 현재 잔액은 {self.balance}원 입니다.")
else:
print("잔액이 부족합니다.")
def get_balance(self):
return self.balance