Commit 44be0841 by BellCodeEditor

save project

parent d6c81a0f
Showing with 22 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=78
self.name=name
self.attack=attack
self.hp=hp
xiao = Hero("魈",21578,1991)
# leidianjiangjun= Hero("雷电将军",18945,2093)
# print(xiao.hp)
# print(leidianjiangjun.hp)
# print(xiao.attack)
# print(leidianjiangjun.attack)
def upgrade():
xiao.level=level+1
xiao.attack=attack+186
xiao.hp=hp+598
upgrade()
upgrade()
print(xiao.level)
print(xiao.attack)
print(xiao.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