Commit d8e91d42 by BellCodeEditor

save project

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