Commit f1c5b236 by BellCodeEditor

auto save

parent f47689a4
Showing with 18 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.lev=2
self.hp=hp
self.attack=attack
self.name=name
def upgrade(self):
self.lev=self.lev+1
self.hp=self.hp+100
self.attack=self.attack+250
kt= Hero("狂铁",28291829773828872999999,250)
print('狂铁的初始血量',kt.hp)
kt.upgrade()
kt.upgrade()
print('升级2次后,血量为',kt.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