Im very new to Python and finding it very different to anything ive encountered before coming from the PHP realm.
Background:
Ive searched SO and learned that the differences between:
x = [] and x{}
is that the brackets will create a list and the curly braces is for creating a series. What I could not find however is an explination for the following
Question
Why does this piece of code use braces inside a list with brackets like so:
context.modules[(stock, length)] = 0
Why the braces inside the list?
And then as a "bonus help" if I may why set it to 0 (although that's probably out of scope of question)
Fullcode:
context.modules = {}
for stock in context.stock_list:
for length in context.channels:
context.modules[(stock, length)] = 0