Commit c2de240c by BellCodeEditor

auto save

parent 8985dd29
Showing with 18 additions and 1 deletions
with open(r"c:\Users\Lenovo\Documents\lesson13-1\sales_list.txt","r",encoding="utf-8")as qwer:
class hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name=name
self.hp=hp
self.attack=attack
def up(self):
self.level=self.level+1
self.hp=self.hp+100000
self.attack=self.attack+10000
sou=hero("sou",100000,10000)
sou.up()
print(sou.level,sou.hp,sou.attack)
sss=hero("sss",100000,10000)
sss.up()
print(sss.level,sss.hp,sss.attack)
\ 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