Commit c2a0a6ac by BellCodeEditor

save project

parent d6c81a0f
Showing with 25 additions and 0 deletions
class Hero:
def _init_(self,name,hp,attack)
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
yao = Hero("耀",)
ludan = Hero("卤蛋",10000,9999999999999999999)
print("耀的血量值为",yao.hp)
print("卤蛋的血量值为",ludan.hp)
def upgrade():
yase.level = yase.level+1
yase.hp = yase.hp+1
yase.attack = yase.attack+1
yase = Hero("耀",1000000,99999999999)
print("耀的血量值为:",yao.hp)
upgrade()
upgrade()
upgrade()
upgrade()
print("耀的血量值为:",yao.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