Commit e6f40fe9 by BellCodeEditor

save project

parent d8e91d42
Showing with 9 additions and 3 deletions
......@@ -4,5 +4,11 @@ class Hero:
self.name=name
self.hp=hp
self.attak=attak
hero1=Hero("晓霞","100","1")
print(hero1.name+"的血量为:"+hero1.hp)
\ No newline at end of file
hero1=Hero("晓霞",100,1)
hero2=Hero("秀玉",50,5)
def up():
hero1.level=hero1.level+1
hero1.hp=hero1.hp+20
hero1.attak=hero1.attak+5
up()
print(hero1.name+"的血量为:",hero1.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