Commit acaad81c by BellCodeEditor

save project

parent 8b2024a5
Showing with 16 additions and 9 deletions
# class Hero: class Hero:
# def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
# self.level=1 self.level=1
# self.name=name self.name=name
# self.attack=attack self.attack=attack
# self.hp=hp self.hp=hp
# dema=Hero("德玛",1234,35) dema=Hero("德玛",1234,35)
# baozoluoi=Hero("暴走萝莉",123,67) baozoluoi=Hero("暴走萝莉",123,67)
# print("暴走萝莉血条:",baozoluoi.hp) # print("暴走萝莉血条:",baozoluoi.hp)
def qwer(): def qwer():
dema.level= dema.level+1
baozoluoi.level=baozoluoi.level+1
dema.hp= dema.hp+50
baozoluoi.hp=baozoluoi.hp+1
dema.attack=+dema.attack+23
baozoluoi.attack=baozoluoi.attack+23
qwer()
print(dema.hp)
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