Automatically creating a list
<p>I am trying to automatically create the following list:</p>

<pre><code>[Slot('1A', '0', 0), Slot('2A', '0', 0),
 Slot('1B', '0', 0], Slot ('2B,'0', 0), ....]
</code></pre>

<p>By defining slot as:</p>

<pre><code>class Slot:
    def __init__(self, address , card, stat):
        self.address = address
        self.card = card
        self.stat = stat


board = []
for i in range(1, 13):
    for j in ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']:
        board.append(Slot ((str(i)+j,'0', 0)))
print(board)
</code></pre>

<p>Using Python 3.5 in Windows. What is wrong? How I can do that? Thanks.</p>

<p>You are passing a single tuple to the constructor. If you remove the parentheses, your code is golden.</p>

<pre><code>From:
board.append(Slot ((str(i)+j,'0', 0)))
To:
board.append(Slot(str(i)+j,'0', 0))
</code></pre>

python python-3.x