Commit 1b9c0fd0 by BellCodeEditor

save project

parent dd207cca
Showing with 10 additions and 1 deletions
......@@ -4,6 +4,14 @@ class Hero:
self.hp=hp
self.attack=attack
self.name=name
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase=Hero('亚瑟',100,30)
print('亚瑟的名字:',yase.name)
upgrade()
print('亚瑟的等级:',yase.level)
\ 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