Commit 40589209 by BellCodeEditor

auto save

parent 098466b3
Showing with 15 additions and 7 deletions
class Hero:
def __init__ (self):
self.ysmj=1
self.clc=11454
self.cjwd=114
yase=Hero()
print(yase.clc)
\ No newline at end of file
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def upgrade(self):
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