Commit b7dad70a by BellCodeEditor

save project

parent 189e0404
Showing with 8 additions and 1 deletions
...@@ -3,5 +3,11 @@ class Hero: ...@@ -3,5 +3,11 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("11",300,20) yase=Hero(11,300,20)
def upgrade():
yase.name=yase.name+1
yase.hp=yase.hp+10
yase.attack=yase.attack+5
upgrade()
print(yase.hp) print(yase.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