Commit e4a09113 by BellCodeEditor

save project

parent d6c81a0f
Showing with 22 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attck):
self.name=name
self.hp=hp
self.attck=attck
self.level=1
def upgrade():
a.level+=1
a.hp+=30
a.attck+=80
a=Hero("a",25000,999)
b=Hero('b',40000,1000)
print(a.level)
print(a.hp)
print(a.attck)
upgrade()
print('升级')
print(a.level)
print(a.hp)
print(a.attck)
\ 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