Associative array/Creation: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 2,931: | Line 2,931: | ||
writeLine(empty) |
writeLine(empty) |
||
var longFruit = Map(int, text).of(1, "banana") # creates a map with the pair 1 => "banana" |
var longFruit = Map(int, text).of(1, "banana") # creates a map with the pair 1 => "banana" |
||
longFruit[2] = "melon" # associates a key of 2 with " |
longFruit[2] = "melon" # associates a key of 2 with "melon" |
||
longFruit.insert(3, "avocado") |
longFruit.insert(3, "avocado") |
||
writeLine(longFruit) # prints the map |
writeLine(longFruit) # prints the map |