Reputation: 296
if there is a syntax like this in python what exactly is it declaring defining?
I tried looking in in the python website did not seen anything like this
children = cell["CHILDREN"]
Upvotes: 1
Views: 85
Reputation: 295
cell is a dictionary. A dictionary is an unordered set of key: value pairs. The element cell["CHILDREN"] is retrieved and stored in the variable children. More on dictionaries here:
Upvotes: -1
Reputation: 13309
That line refers to dictionaries, also known as associative arrays. The line of code in question assigns the value in the dictionary that associates to the key CHILDREN
to the variable children
.
Read more about this in a great related Stack Overflow question.
Upvotes: 1
Reputation: 18940
It is accessing the item in dictionary cell
with key "CHILDREN"
and assigning it to the variable children
.
More useful references:
Upvotes: 2