Commit 96d52000 by BellCodeEditor

save project

parent d6c81a0f
Showing with 20 additions and 0 deletions
class hero():
def __init__(self,name,hp,atk):
self.level=1
self.hp=hp
self.atk=atk
self.name=name
yase=hero("亚瑟",300,20)
y1ase=hero("后裔",250,23)
print(yase.hp)
print(y1ase.hp)
print(yase.name)
print(y1ase.name)
print(yase.atk)
print(y1ase.atk)
for i in range(10):
yase.level=yase.level+1
yase.hp=yase.hp+1
yase.atk=yase.atk+1
print(yase.atk)
print(yase.hp)
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