creating a nested list class within python
<p>I can't figure out what I'm doing wrong. I have to create a nested list(of possible solutions to a problem), so I created a class that appends a solution to a list of existing solutions(since each solution is being calculated one at a time)</p>

<p>This function works fine:</p>

<pre><code>def appendList(list):
    #print list
    list2.append(list)

x =0
while x &lt; 10:
    x = x+1
    one = "one"
    two = "two"
    appendList([(one), (two)])

print list2
</code></pre>

<p>with a result of:</p>

<pre><code>[['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two'], ['one', 'two']]
</code></pre>

<p>but when I take this exact same function and put it in a class, I get an error saying:</p>

<pre><code>TypeError: appendList() takes exactly 1 argument (2 given)
</code></pre>

<p>Here's the class and how I call it:</p>

<blockquote>
<pre><code>class SolutionsAppendList:
    list2 = []
    def appendList(list):
    #print list
        list2.append(list)
</code></pre>
</blockquote>

<pre><code>appendList.appendList([('one'), ('two')])
</code></pre>

<p>I'm sure I'm making a very basic error but I can't seem to figure out why, since I'm using the same function in the class. </p>

<p>Any suggestions/advice would be great.
Thanks</p>
