Skip to content
Course map | Lesson 2 of 5

Data Structures · 4.2

Maps

All lessons are open — jump whenever you need.

let scores = Map::new()
scores.set("Alice", 95)
scores.set("Bob", 87)

print(scores.get("Alice")) // 95
print(scores.has("Charlie")) // false

for key in scores.keys() {
    print("{key}: {scores.get(key)}")
}

Goal: Create a map of capitals and print the capital of Brazil.

lesson-4-2.zolo
Program output

Run the code to see the output

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br