A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-102.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6m:=map[string]int{"a":1}
7m["a"]=0
8v,ok:=m["a"]
9fmt.Println(v,ok)
10}
Maps
Answer & explanation
Console output
0 true
Why
Assigning m["a"] = 0 overwrites the value but keeps the key present; it is not a deletion. So the comma-ok read returns the stored value 0 and ok = true. To actually remove the entry you would call delete(m, "a").