Commit 9a32be0d by BellCodeEditor

save project

parent 0469270a
Showing with 6 additions and 0 deletions
...@@ -4,5 +4,10 @@ class Hero: ...@@ -4,5 +4,10 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def up():
baiqi.level=baiqi.level+1
baiqi.hp=baiqi.hp+50
baiqi.attack=baiqi.attack+4
baiqi=Hero("baiqi",300,51) baiqi=Hero("baiqi",300,51)
up()
print("baiqi:",baiqi.hp) print("baiqi:",baiqi.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