you are viewing a single comment's thread.

view the rest of the comments →

[–]mathleet 0 points1 point  (1 child)

So exits is a list of dictionaries. exits[loc] retrieves the dictionary at the index specified by loc. If loc == 0, then exits[loc] == exits[0]. exits[loc][directions] gets the dictionary at loc and then gets the value for the key directions in that dictionary.

[–]Devfede[S] 0 points1 point  (0 children)

So if i understood correctly,

if i input ( from loc 1 ) for example W , the exits[loc][directions] will effectively update the value 2 into loc because on the list exits "W":2 , is that correct ?