//: Playground - noun: a place where people can playimport UIKit// 注意: swift中的字典用的也是中括号, 和OC的大括号是不同的// 初始化字典var dict1 = [1:"one", 2:"two", 3:"three"] // 隐式//var dict1:Dictionary= [1:"one", 2:"two", 3:"three"] //显式//var dict1:[Int:String] = [1:"one", 2:"two", 3:"three"]var dict2 = ["a":"Rinpe", "b":"Bobo", "c":"Lili"]//var dict2:Dictionary = ["a":"Rinpe", "b":"Bobo", "c":"Lili"]//var dict2:[String:String] = ["a":"Rinpe", "b":"Bobo", "c":"Lili"]// 根据Key找到valuedict1[1]dict2["a"]// 创建一个空的字典var nullDict = Dictionary ()var nullDict2 = [String:String]()// 清空一个字典dict1 = [:]dict1 = [Int : String]();