Commit 94c31170 by BellCodeEditor

save project

parent d6c81a0f
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def upgrade():
xiaoheizi.level=xiaoheizi.level+1
xiaoheizi.hp=xiaoheizi.hp+50
xiaoheizi.attack=xiaoheizi.attack+4
xiaoheizi=Hero('yase',366666666666666666666,2090099999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
print("初始属性为:",xiaoheizi.hp)
upgrade()
upgrade()
print("升级之后属性为:",xiaoheizi.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