RosettaCodeData/Task/Associative-array-Creation/MiniScript/associative-array-creation.mini

8 lines
184 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
map = { 3: "test", "foo": 42 }
print map[3]
map[3] = "more tests"
print map[3]
print map["foo"]
print map.foo // same as map["foo"] (only for string keys that are valid identifiers)