Commit 7fd64144 by BellCodeEditor

save project

parent 5b66a6d6
Showing with 10 additions and 7 deletions
class hero:
def __init__(self):
self.level=1
self.hp=300
self.attack=50
yuanfang=hero()
print(yuanfang.hp)
\ No newline at end of file
def __init__(self,name,hp,attack):
self.lever=1
self.name=name
self.hp=hp
self.attack=attack
yase=hero('yese',300,20)
hy=hero("hy",250,30)
print(yase.attack)
print(hy.attack)
\ 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