Commit 9229bcc4 by BellCodeEditor

save project

parent d6c81a0f
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attsck):
self.leven = 1
self.name = name
self.hp = hp
self.attsck = attsck
def upgrade():
yase.leven =yase.leven+1
yase.hp = yase.hp+50
yase.attsck = yase.attsck+4
yase = Hero("垭瑟",300,20)
houyi = Hero("后裔",240,22)
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