It is possible to \'fill\' an array in Python like so:
> [0] * 10 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
I wanted to use this sample principle t
A simple list comprehension should do the trick:
>>> a = [{'key': 'value'} for _ in range(3)] >>> a [{'key': 'value'}, {'key': 'value'}, {'key': 'value'}] >>> a[0]['key'] = 'poop' >>> a [{'key': 'poop'}, {'key': 'value'}, {'key': 'value'}]