Commit ef971696 by BellCodeEditor

save project

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