Commit 45e30b1d by BellCodeEditor

save project

parent d6c81a0f
Showing with 17 additions and 0 deletions
class kale:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def upg(self):
self.level = self.level + 1
self.hp = self.hp + 25
self.attack = self.attack + 4
huonan = kale("火男",100,78)
qianbao = kale("钱包",100,160)
huonan.upg()
print("火男的等级",huonan.level)
print("火男的血量",huonan.hp)
print("火男的攻击力",huonan.attack)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment