Commit 602175e2 by BellCodeEditor

save project

parent cc376ebc
Showing with 17 additions and 0 deletions
class hero:
def __init__(self,name,hp,attaack):
self.level=1
self.hp=hp
self.attaack=attaack
def uphero(self):
self.level+=1
self.hp+=400
self.attaack+=100
neigui=hero('内鬼',100,1000)
shehunguai=hero('摄魂怪',1000,1000)
print('内鬼的生命',neigui.hp)
print('内鬼的等级',neigui.level)
print('摄魂怪的生命',shehunguai.hp)
print('摄魂怪的等级',shehunguai.level)
\ 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