Commit ff6d6d37 by BellCodeEditor

save project

parent 1282e4e3
Showing with 7 additions and 9 deletions
...@@ -5,12 +5,11 @@ class Pokemon: ...@@ -5,12 +5,11 @@ class Pokemon:
self.hp=hp self.hp=hp
self.JN1=JN1 self.JN1=JN1
self.JN2=JN2 self.JN2=JN2
def upgrade(): def upgrade(self):
MWZZ.level =MWZZ.level+1 self.level =self.level+1
MWZZ.hp=MWZZ.hp+10 self.hp=self.hp+10
MWZZ= Pokemon("妙蛙种子",15,"寄生种子 30","藤鞭 40") MWZZ= Pokemon("妙蛙种子",15,"寄生种子 30","藤鞭 40")
print("妙蛙种子的初始血量为:",MWZZ.hp) MWZZ.upgrade()
print("妙蛙种子的技能是:",MWZZ.JN1) print("初始血量为:",MWZZ.hp)
print("妙蛙种子的技能是:",MWZZ.JN2) print("技能是:",MWZZ.JN1)
upgrade() print("技能是:",MWZZ.JN2)
print("妙蛙种子的升级一次后血量为:",MWZZ.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