Commit 8710d1c0 by BellCodeEditor

save project

parent b3042f5b
Showing with 453 additions and 4 deletions
......@@ -5,10 +5,459 @@ class hero:
self.level=1
self.hp=hp
self.attack=attack
ys=hero("垭瑟",30,1000,60)
he=hero("后羿",40,999,149)
print(ys.name,ys.age,ys.level,ys.hp,ys.attack)
print(he.name,he.age,he.level,he.hp,he.attack)
def upgrade(self):
self.hp=self.hp+50
self.level=self.level+1
self.attack=self.attack+20
hy=hero("后羿",12,1,100,40)
hy.upgrade()
hy.upgrade()
print(hy.hp)
#he=hero("后羿",40,999,149)
#print(ys.name,ys.age,ys.level,ys.hp,ys.attack)
#print(he.name,he.age,he.level,he.hp,he.attack)
......
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