擅长:python、mysql、java
<p><code>availablebook</code>应该是<code>__init__</code>函数中的列表</p>
<pre><code>self.availablebook = []
</code></pre>
<p>另外,修改<code>while</code>循环</p>
<pre><code>while True:
print('enter 1 for add book,2 for borrow book,3 to exit')
x = int(input())
if(x==1):
Customer().borrow()
elif(x==2):
Customer().returnbook()
else:
print('exiting')
quit()
</code></pre>