I am trying to automatically create the following list:
[Slot('1A', '0', 0), Slot('2A', '0', 0),
Slot('1B', '0', 0], Slot ('2B,'0', 0), ....]
By defining slot as:
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)
Using Python 3.5 in Windows. What is wrong? How I can do that? Thanks.
TypeErrorin there but not entirely sure it's a proper action to take.