Commit d73d9f97 by BellCodeEditor

save project

parent 7f4531d5
Showing with 23 additions and 0 deletions
class hero:
def __init__(self,name,level,hp,attack):
self.level=level
self.hp=hp
self.attack=attack
self.name=name
def a(self):
self.level+=1
self.hp+=500
self.attack+=100
LuBan=hero('鲁班',1,2500,200)
HouYi=hero('后羿',1,3000,230)
print(LuBan.name)
print(LuBan.level)
print(LuBan.hp)
print(LuBan.attack)
a()
print(LuBan.name)
print(LuBan.level)
print(LuBan.hp)
print(LuBan.attack)
\ 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