Commit 0d9901b4 by BellCodeEditor

save project

parent 06510e06
Showing with 18 additions and 10 deletions
class Hero:
def __init__(self,name,hp,attack):
self.name = name
self.hp = hp
self.attack = attack
yase=Hero('亚瑟',300,20)
houyi=Hero('后羿',250,23)
print(yase.name,houyi.name)
print(yase.hp,houyi.hp)
print(yase.attack,houyi.attack)
\ No newline at end of file
def new_yase():
def __init__(self):
self.level=1
self.hp=300
self.attack=20
yase=Hero(yase.level=level+1)
yase=Hero(yase.hp=hp+50)
yase=
# def __init__(self,name,hp,attack):
# self.name = name
# self.hp = hp
# self.attack = attack
# yase=Hero('亚瑟',300,20)
# houyi=Hero('后羿',250,23)
# print(yase.name,houyi.name)
# print(yase.hp,houyi.hp)
# print(yase.attack,houyi.attack)
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