Commit aa1ec594 by BellCodeEditor

save project

parent e9a3fa13
Showing with 77 additions and 8 deletions
......@@ -4,12 +4,6 @@ class Hero:
self.name=name
self.hp=hp
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():
yase.level=yase.level+1
yase.hp=yase.hp+50
......@@ -20,4 +14,80 @@ uprrade()
uprrade()
print("调用两次后等级为",yase.level)
print("调用两次后防御力为",yase.hp)
print("调用两次后攻击力为",yase.attack)
\ No newline at end of file
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