Printing values from non-existing keys

Report a typo

Suppose you have a Go program that has the animals map:

package main

import "fmt"

func main() {
    var animals = map[string]string{
        "dog":     "🐕",
        "horse":   "🐎",
        "rooster": "🐓",
        "pig":     "🐖",
        "monkey":  "🐒",
    }
    fmt.Println(animals["cat"])
}

What would be the output of the fmt.Println(animals["cat"]) statement?

Select one option from the list
___

Create a free account to access the full topic