Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Size of map (len)

package main

import "fmt"

func main() {
	scores := map[string]int{"Alma": 23, "Cecilia": 12, "Berta": 78}
	fmt.Println(len(scores))
	scores["David"] = 37
	fmt.Println(len(scores))
	delete(scores, "Alma")
	fmt.Println(len(scores))
}
3
4
3