Commit 65b476ce by BellCodeEditor

save project

parent ebfb79f5
Showing with 10 additions and 2 deletions
...@@ -3,4 +3,12 @@ class Hero: ...@@ -3,4 +3,12 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(self):
\ No newline at end of file self.name=self.name
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero('维阿',30,100)
yase.upgrade()
print(yase.hp)
print(yase.name)
print(yase.attack)
\ 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