

catalog={'aa':3,'bb':0,'cc':5,'dd':2,'ee':4,'ff':1,'gg':8,'hh':3}
class Book():
global catalogdef init(self,name):
self.name=nameself.word='12345'def loop (self,name):for key, value in catalog.items():if key==name :if value!=0:print('There is the book!')elif value==0:print('I'm sorry that the book has been borrowed!')
else:print('It's a pity that there is no book!')
breakdef seek (self, pword,name,value):
if pword!='12345':return print('You don't have the right to add a new book!')
else:catalog[name]=valueprint(catalog)bnm=input('Enter book name:')
studentB=Book(bnm)
studentB.loop(bnm)
psw=input('Enter password:')
num=input('Enter nubmer:')
studentB.seek(psw,bnm,num)
def seek()整个函数往右移动一个tab格即可