Commit fa2c9bae by BellCodeEditor

save project

parent fc479b2e
Showing with 6 additions and 8 deletions
...@@ -4,14 +4,13 @@ class Jojo: ...@@ -4,14 +4,13 @@ class Jojo:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade(self):
baijinzhixing.level=baijinzhixing.level+1 self.level=self.level+1
baijinzhixing.hp=baijinzhixing.hp+44 self.hp=self.hp+44
baijinzhixing.attack=baijinzhixing.attac+99999000000000 self.attack=self.attack+99999000000000
baijinzhixing=Jojo("白金之星",56,1000000000) baijinzhixing=Jojo("白金之星",56,1000000000)
baijinzhixing.upgrade()
print("白金之星的血量为:",baijinzhixing.hp) print("白金之星的血量为:",baijinzhixing.hp)
upgrade()
upgrade()
print("白金之星的血量为:",baijinzhixing.hp) print("白金之星的血量为:",baijinzhixing.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