Commit aa1ec594 by BellCodeEditor

save project

parent e9a3fa13
Showing with 76 additions and 6 deletions
...@@ -4,12 +4,6 @@ class Hero: ...@@ -4,12 +4,6 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
"""yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
k=Hero('K',5600,199)
print("y的属性:",yase.attack,yase.hp)
print("h的属性:",hy.attack,hy.hp)
print("k的属性:",k.attack,k.hp)"""
def uprrade(): def uprrade():
yase.level=yase.level+1 yase.level=yase.level+1
yase.hp=yase.hp+50 yase.hp=yase.hp+50
...@@ -21,3 +15,79 @@ uprrade() ...@@ -21,3 +15,79 @@ uprrade()
print("调用两次后等级为",yase.level) print("调用两次后等级为",yase.level)
print("调用两次后防御力为",yase.hp) print("调用两次后防御力为",yase.hp)
print("调用两次后攻击力为",yase.attack) print("调用两次后攻击力为",yase.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