SHARE
TWEET

Untitled

a guest Apr 25th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main(){
  6.     rating := map[string]float32 {"C":5,"Go":4.5,"Python":4.5,"C++":2}
  7.     fmt.Println(rating)
  8.     // console'dan verileri yazd─▒r─▒rken neden veritipini
  9.     //yaz─▒yor anlam─▒yorum.
  10.     csharpRating, ok := rating["C#"]//her ikisine C# keyini mi atad─▒?
  11.     fmt.Println(csharpRating)
  12.     if ok   {
  13.         fmt.Println("C# is in the map and its rating is",csharpRating)
  14.     } else  {
  15.         fmt.Println("We have no rating associated with c# in the map")
  16.     }
  17.     fmt.Println(rating)
  18.     delete(rating,"C")
  19.     fmt.Println(rating)
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top