Commit 289a5146 by BellCodeEditor

save project

parent 72132f35
Showing with 12 additions and 7 deletions
class hero: class hero:
def __init__(self): def __init__(self,name,hp,attack):
self.HP=2500 self.hp=hp
self.attack=300 self.attack=attack
LuBan=hero() self.name=name
print(LuBan.HP) LuBan=hero('鲁班',2500,200)
print(LuBan.attack) HouYi=hero('后羿',3000,230)
\ No newline at end of file print(LuBan.name)
print(LuBan.hp)
print(LuBan.attack)
print(' ')
print(HouYi.name)
\ 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