Commit 5ca3e00d by BellCodeEditor

save project

parent 6c87eb18
Showing with 16 additions and 5 deletions
#class Hero:
# def __init__(self):
# self.level=1
# self.hp=300
# self.attack=20
#yase=Hero()
#print(yase.hp)
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=300 self.name=name
self.attack=20 self.hp=hp
yase=Hero() self.attack=attack
print(yase.hp) yasuo=Hero("亚索",500,50)
weien=Hero("薇恩",300,55)
print("亚索的血量是:",yasuo.hp)
print("薇恩的血量是:",weien.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