Commit 920d047d by BellCodeEditor

save project

parent d6c81a0f
Showing with 16 additions and 0 deletions
class Hero:
def __init__(self,name,hp,gongji):
self.level=1
self.name=name
self.hp=hp
self.gongji=gongji
def cjwd():
tanyayun.level=tanyayun.level+1
tanyayun.hp=tanyayun.hp+50
tanyayun.gongji=tanyayun.gongji+5
tanyayun=Hero('炭雅均',114514,114)
ysmj=Hero('毛巾卷',258000,114514)
cjwd()
print("炭雅均的生命值是:",tanyayun.hp)
print("毛巾卷的生命值是:",ysmj.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