Commit a786f286 by BellCodeEditor

save project

parent d6c81a0f
Showing with 22 additions and 0 deletions
class plant:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
xiangrikui=plant("yangrikui",30,0)
wandousheshou=plant("wandousheshou",50,200)
print(xiangrikui.hp)
print(wandousheshou.name)
def upset():
xiangrikui.level= xiangrikui.level+1
xiangrikui.hp=xiangrikui.hp+20
xiangrikui.attack=xiangrikui.attack+30
def upst():
wandousheshou.level=wandousheshou.level+1
wandousheshou.hp=wandousheshou.hp+50
wandousheshou.attack=wandousheshou.attack+30
upset()
upst()
print(xiangrikui.hp)
print(wandousheshou.hp)
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