Commit 40589209 by BellCodeEditor

auto save

parent 098466b3
Showing with 15 additions and 7 deletions
class Hero: class Hero:
def __init__ (self): def __init__(self,name,hp,attack):
self.ysmj=1 self.level=1
self.clc=11454 self.name=name
self.cjwd=114 self.hp=hp
yase=Hero() self.attack=attack
print(yase.clc) def upgrade(self):
\ No newline at end of file self.level=yase.level+1
self.hp=yase.hp+1
self.attack=yase.attack+1
yase=Hero("亚瑟",200,20)
houyi=Hero("后裔",300,25)
yase.upgrade()
print("yase的血量为",yase.hp)
print("houyi的血量为",houyi.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