ajax_velu
ajax_velu

Reputation: 296

What is this syntax in Python

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

Answers (3)

zxvn
zxvn

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

Joseph Hansen
Joseph Hansen

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

fferri
fferri

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

Related Questions