Commit c5c6b393 by BellCodeEditor

save project

parent 22354288
Showing with 16 additions and 0 deletions
class Hero:
def __init__(self,name,hp,gjl,fyl):
self.name=name
self.hp=hp
self.gongjili=gjl
self.fangyuli=fyl
def shengji(self):
self.hp=self.hp+4.166666666666667
self.gongjili=self.gongjili+10
self.fangyuli=self.fangyuli+0.5
duixiang1=Hero("xueshanjingying",120,0,0)
duixiang1.shengji()
print(duixiang1.hp)
print(duixiang1.gongjili)
print(duixiang1.fangyuli)
\ 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