Skip to content

Commit

Permalink
Merge pull request #4 from 0bvim/feat/section16
Browse files Browse the repository at this point in the history
chore: hands on exercices
  • Loading branch information
0bvim authored Oct 21, 2024
2 parents 3b671e7 + dc3b91a commit 1a48f57
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/udemy/go_ted/section16/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package main

import "fmt"

func main() {
favorites := make(map[string][]string)

favorites["bond_james"] = []string{"shaken, not stirred", "martinis", "fast cars"}
favorites["moneypenny_jenny"] = []string{"intelligence", "literature", "computer science"}
favorites["no_dr"] = []string{"cats", "ice cream", "sunsets"}

for key, value := range favorites {
fmt.Println("Record for", key)
for i, value := range value {
fmt.Printf("%v - %v\n", i, value)
}
}
fmt.Println("-------------------------")

delete(favorites, "bond_james")

for key, value := range favorites {
fmt.Println("Record for", key)
for i, value := range value {
fmt.Printf("%v - %v\n", i, value)
}
}
fmt.Println("-------------------------")

}

0 comments on commit 1a48f57

Please sign in to comment.