2024-01-15 23:25:45 +00:00
|
|
|
package maps
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
func Demo1() {
|
|
|
|
my_dictionary := make(map[string]string)
|
|
|
|
// key - value
|
|
|
|
my_dictionary["table"]="Masa"
|
|
|
|
my_dictionary["book"]="kitap"
|
|
|
|
my_dictionary["pencil"]="Kalem"
|
|
|
|
|
|
|
|
fmt.Println(my_dictionary["book"])
|
2024-01-15 23:28:55 +00:00
|
|
|
fmt.Println("String number : ", len(my_dictionary))
|
2024-01-15 23:33:11 +00:00
|
|
|
fmt.Println("Dictionary", my_dictionary)
|
2024-01-15 23:31:34 +00:00
|
|
|
delete(my_dictionary, "book")
|
|
|
|
fmt.Println("String number : ", len(my_dictionary))
|
2024-01-15 23:33:11 +00:00
|
|
|
fmt.Println("Dictionary", my_dictionary)
|
2024-01-15 23:25:45 +00:00
|
|
|
}
|