class Character:
def __init__(self, nickname, level, exp):
self.nickname = nickname
self.level = level
self.exp = exp
def gain_exp(self, amount):
self.exp += amount
while self.exp >= 100:
self.level += 1
self.exp -= 100
def status(self):
print(f"현재 레벨: {self.level} 현재 경험치: {self.exp}")
cha = Character("캐릭터1", 1, 250)
cha.status()
cha.gain_exp(0)
cha.status()
To embed this project on your website, copy the following code and paste it into your website's HTML: