Skip to content

Commit

Permalink
Merge pull request #38002 from madmiraal/fix-class_dictionary
Browse files Browse the repository at this point in the history
Correct Dictionary addition of a key and the duplication of a variable name.
  • Loading branch information
akien-mga authored Apr 19, 2020
2 parents 039abbb + 4d41535 commit 495b287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/classes/Dictionary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[codeblock]
var my_dir = {} # Creates an empty dictionary.
var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
var my_dir = {
var another_dir = {
key1: value1,
key2: value2,
key3: value3,
Expand All @@ -34,7 +34,7 @@
To add a key to an existing dictionary, access it like an existing key and assign to it:
[codeblock]
var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
var points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
[/codeblock]
Finally, dictionaries can contain different types of keys and values in the same dictionary:
[codeblock]
Expand Down

0 comments on commit 495b287

Please sign in to comment.