Python: get items from itemlist
<p>I'm python newbie and found something difficult while doing some practices.</p>

<p>I have few def functions under a class look like:</p>

<pre><code>Class A(object):

    def __init__(self):

        self.itemID = []
        self.itemlist = []

    def add(self, ID, list):

        self.itemID.append(ID)
        self.itemlist.append(list)

    def get_item(self,ID):

        self.ID = ID
        result = []
        for self.ID in self.itemlist:
            result.append(self.itemlist)
        return result
</code></pre>

<p>I'm having problems with "def get_item". Here's an example..</p>

<p>if i do:</p>

<pre><code>A.add('abc', 'bcd')

A.add('abc1', 'bcd1')

A.get_item('abc')
</code></pre>

<p>This should return abc, bcd but mine returns [['bcd', 'bcd1'], ['bcd', 'bcd1']]...</p>

<p>Apologise for the long complicated dumb looked codes.... Any feedbacks would be so appreciated.. Thanks</p>
