Commit fb5f247f by BellCodeEditor

save project

parent 0769f3c5
Showing with 6 additions and 1 deletions
...@@ -2,6 +2,10 @@ class Hero(): ...@@ -2,6 +2,10 @@ class Hero():
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=300 self.hp=300
self.attck=attack self.attack=attack
yase=Hero('亚瑟',300,20) yase=Hero('亚瑟',300,20)
def updata():
yase.hp+=30
yase.attack+=30
updata()
print(yase.hp) print(yase.hp)
\ 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