Aug-02-2021, 03:16 PM
(This post was last modified: Aug-02-2021, 03:17 PM by deanhystad.)
This does not give you three dictionaries. It gives you 1 dictionary three times.
b = [{"arrayA":1, "arrayB":6}] * 3Essentially what you are doing is this:
a = {"arrayA":1, "arrayB":6} b = [a, a, a]You could use a comprehension.
b = [{"arrayA":1, "arrayB":6} for _ in range(3)]This is not a json thing. It is a characteristic of lists and a very common and confusing Python problem