Commit d8e91d42 by BellCodeEditor

save project

parent 5f36a97f
Showing with 8 additions and 7 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attak):
self.live=2 self.level=1
self.hp=100 self.name=name
self.attenk=10 self.hp=hp
a=Hero() self.attak=attak
print(a.hp) hero1=Hero("晓霞","100","1")
\ No newline at end of file print(hero1.name+"的血量为:"+hero1.hp)
\ 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