Commit 9477fba5 by BellCodeEditor

save project

parent bdbfae78
Showing with 7 additions and 0 deletions
...@@ -6,5 +6,11 @@ class hero: ...@@ -6,5 +6,11 @@ class hero:
self.attack=attack self.attack=attack
ys=hero("ys",300,20) ys=hero("ys",300,20)
hy=hero("hy",250,23) hy=hero("hy",250,23)
def upgrade():
ys.level=ys.level+1
ys.hp=ys.hp+50
ys.attack=ys.attack+1
upgrade()
print("ys",ys.hp) print("ys",ys.hp)
print("hy",hy.hp) print("hy",hy.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