Commit e9902d50 by BellCodeEditor

save project

parent d6c81a0f
Showing with 22 additions and 0 deletions
class Hero():
def __init__(self,name,hp,attack,baoji):
self.level = 1
self.hp = hp
self.attack = attack
self.baoji = baoji
ya_suo = Hero("ya_suo",300,20,10)
a_li = Hero("a_li",250,23,0)
#升级函数
def upji():
ya_suo.hp=ya_suo.hp+50
ya_suo.attack=ya_suo.attack+4
ya_suo.baoji=ya_suo.baoji+10
upji()
print(ya_suo.hp)
# print(ya_suo.hp)
# print(a_li.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