Commit 1c2f037c by BellCodeEditor

save project

parent 92b6f17e
Showing with 9 additions and 7 deletions
class Hero:
def__init__(self,name,hp,ac):
def __init__(self,name,hp,ac):
self.lv = 1
self.name = name
self.hp = hp
self.ac = ac
def ug():
yase.lv+=1
yase.hp+=100
yase.ac+=50
def ug(self):
self.lv+=1
self.hp+=100
self.ac+=50
yase = Hero("亚瑟",300,25)
print("亚瑟的血量为:",yase.hp)
yase.ug()
print("亚瑟的血量为:",yase.hp)
print("亚瑟的血量:",yase.hp)
......
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