Commit ff6d6d37 by BellCodeEditor

save project

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