Commit 94848ee7 by BellCodeEditor

save project

parent fb7e072d
Showing with 16 additions and 5 deletions
"C:\Users\Administrator\Desktop\book.txt""C:\Users\Administrator\Desktop\book.txt"
open("C:\Users\Administrator\Desktop\book.txt")
class Hero:
def __init__(self,name,hp,attaack):
self.level=1
self.name=name
self.hp=hp
self.attaack=attaack
def upgraed(self):
self.level=self.level+1
seilf.hp=self.hp+50
self.attack=self.attack+4
ministrator\Desktop\book.txt""C:\Users\Administrator\Desktop\book.txt""C:\Users\Administrator\Desktop\book.txt"
upgrade()
\ No newline at end of file
houyi=Hero("后翼",240,23)
houyi.upgraed()
print("等级"houyi.level)
print("血量"houyi.hp)
print("功即力"houyi.attaack)
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