Go Coding Practice
Practice typing real code syntax, including brackets, punctuation, and indentation. Snippets are for typing practice only and are never executed.
Count words with a map
Type the code exactly. Tab inserts four spaces. Code is not executed.
Progress: 0%
Current mismatches: 0
package main
import "fmt"
func main() {
words := []string{"go", "code", "go", "learn"}
counts := make(map[string]int)
for _, word := range words {
counts[word]++
}
fmt.Println(counts)
}
Type the code exactly, including spaces and indentation.