7 lines
184 B
Text
7 lines
184 B
Text
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)
|