Knaph

Composite Types36 of 62

Map Lookup

The starter code reads n name age pairs into a map[string]int, then reads a query name. Look up query using the two-value form (age, ok := ages[query]) and print the age if ok is true, otherwise print not found.

Sign in to try this exercise.