擅长:python、mysql、java
<p>只需要两种方法。Init hop_-list-in-the-Init-Init\u或者hoppill的实例将共享该列表:</p>
<pre><code>class HopBill(object):
def __init__(self):
self.hop_list = []
def add(self, hop):
self.hop_list.append(hop)
def addnew(self, variety, aa, qty, time):
hop = Hop(variety, aa, qty, time)
self.add(hop)
</code></pre>