Commit ef971696 by BellCodeEditor

save project

parent 4283fc06
Showing with 9 additions and 7 deletions
class Hero:
def __init__(self):
self.level=1
self.hp=100
self.attack=40
def __init__(self,name,hp):
self.name=name
self.hp=hp
yase=Hero()
print(yase.hp)
\ No newline at end of file
yase=Hero("亚瑟",300)
hoyi=Hero("后裔",240)
print(yase.hp)
print(hoyi.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