Commit b7c57988 by BellCodeEditor

save project

parent 60ec0e03
Showing with 13 additions and 0 deletions
class Hero: class Hero:
def __init__(self,name,hp): def __init__(self,name,hp):
self.level=1
self.name=name self.name=name
self.hp=hp self.hp=hp
yase=Hero("亚瑟",300) yase=Hero("亚瑟",300)
hoyi=Hero("后裔",240) hoyi=Hero("后裔",240)
def upgrde():
yase.level=yase.level+1
yase.hp=yase.hp+100
upgrde()
upgrde()
print(yase.hp) print(yase.hp)
print(hoyi.hp) print(hoyi.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