Commit e098744b by BellCodeEditor

auto save

parent 9bf3764e
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,sttack):
self.level=1
self.name = name
self.hp=hp
self.sttack=sttack
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+1
self.sttack=self.sttack+1
yase=Hero("yase",900,500)
yase.upgrade()
print("血量为:"yase.up)
print("攻击为:"yase.attack)
print("等级为:"yase.level)
enemy
\ 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