Commit cb58f0c6 by BellCodeEditor

save project

parent c2016c77
Showing with 5 additions and 4 deletions
...@@ -4,12 +4,13 @@ class hero: ...@@ -4,12 +4,13 @@ class hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
SunWuKong=hero("孙悟空",300,100000) SunWuKong=hero("孙悟空",400,100000)
yao=hero("瑶",200,50) yao=hero("瑶",200,50)
print(SunWuKong.hp) print(SunWuKong.hp)
print(yao.hp) print(yao.hp)
def up(): def up():
yao.level+=1 yao.level+=1
yao.hp+=1000 yao.hp+=1000
yao.attack+=500 yao.attack+=50
print(yao.level) up()
\ No newline at end of file print(yao.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