catalog={'aa':3,'bb':0,'cc':5,'dd':2,'ee':4,'ff':1,'gg':8,'hh':3}
class Book():
global catalog
def init(self,name):
self.name=name
self.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!')
break
def seek (self, pword,name,value):
if pword!='12345':
return print('You don't have the right to add a new book!')
else:
catalog[name]=value
print(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)