Dictionaries
The concept of a data structure with mapped keys to values changes drastically across output languages. All support some form of creating a dictionary and getting or setting values in it.
Create a new dictionary with dictionary new
, which takes in the key and value types of the dictionary. Accessing members is done with dictionary get
and setting is done with with dictionary set
.
In C#:
In Python:
Alternately, create a multi-line initialization with dictionary new start
, which is otherwise identical, and dictionary new end
. Describe each pair of initial values inside with dictionary pair
, which takes in the key type, value type, and a ,
if it isn't the last pair of initialization.
In C#:
In Python:
Last updated