Commit 289a5146 by BellCodeEditor

save project

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