Commit 37a99423 by BellCodeEditor

save project

parent e4e01378
Showing with 15 additions and 5 deletions
class Hero: class Hero:
def __inif__(self,name,hp,attack): def __inif__(self,name,hp,attack):
self.leve1=100 self.leve1=1
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase = Hero("铠爹",30000000000000000,20000000000000) kaidie = Hero("铠爹",30000000000000000,20000000000000)
houyi=Hero("鲁班",1099999999999999999999999999999,30) houyi=Hero("鲁班",1099999999999999999999999999999,30)
print("铠爹的血量为:",kaidie,hp) print("铠爹的血量为:",kaidie,hp)
print("鲁班的血量为:",,hp) print("鲁班的血量为:",,hp)
\ No newline at end of file def upgrade():
kaidie.leve1=kaidie.leve1+1
kaidie.hp=kaidie.hp+10000000000000000000000000000
kaidie.attack=kaidie.attack+5000000000000000000000000000
kaidie = Hero("铠爹",30000000000000000,20000000000000)
print("铠爹的初始血量为:",kaidie,hp)
upgrade()
upgrade()
print("升级2次后,铠爹的初始血量为:",kaidie,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