Commit cf4db5f2 by BellCodeEditor

save project

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