Commit cf4db5f2 by BellCodeEditor

save project

parent 45819594
Showing with 10 additions and 7 deletions
class hero:
def __init__(self):
self.Hp = 300
self.level = 100
self.attack = 100
shi=hero()
print(shi.Hp)
\ No newline at end of file
def __init__(self,name,Hp,attack):
self.name = name
self.Hp = Hp
self.attack = attack
self.level = 1
shi=hero("shi",300,100)
pi=hero("pi",100,300)
print(shi.name)
print(pi.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