Commit 1af3cf1e by BellCodeEditor

save project

parent eb1dc9c5
Showing with 8 additions and 6 deletions
class Hero: class Hero:
def __init__ (self): def __init__ (self,name,hp,attack):
self.level=1 self.level=999
self.hp=8000 self.name=name
self.attack=50 self.hp=hp
laoliou=Hero self.attack=attack
laoliou=Hero("老六",8000,1)
laoba=Hero("老八",8888,1)
print(laoliou.hp) print(laoliou.hp)
print(laoba.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