Commit 294d5b46 by BellCodeEditor

save project

parent 4657e1ac
Showing with 7 additions and 7 deletions
class Hero:
def __init__(self):
self.level=1
self.hp=300
self.attact=20
yase=Hero()
print(yase.level,yase.hp,yase.attact)
\ No newline at end of file
def __init__(self,level,hp,attact):
self.level=level
self.hp=hp
self.attact=attact
lizhuocheng=Hero(1,300,10)
print(lizhuocheng.level,lizhuocheng.hp,lizhuocheng.attact)
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