Commit 9b4548d6 by BellCodeEditor

auto save

parent 9a665dbe
Showing with 16 additions and 7 deletions
class Hero:
def __init__(self):
def __init__(self,name,hp,attack):
self.leven = 1
self.hp = 300
self.attack = 20
yese=Hero()
print(yese.hp)
\ No newline at end of file
self.name = name
self.hp = hp
self.attack = attack
def upgrade():
yase.leven = yase.leven+1
yase.hp = yase.hp+50
yase.attack = yase.attack+4
yase=Hero("娅瑟",300,20)
print("娅瑟的初始血量是",yase.hp)
upgrade()
upgrade()
print("娅瑟升级2次后的血量是",yase.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