var courses = [76:"慕课网2048私人订制",77:"CSS3 3D 特效",127:"玩儿转Swift"] var websites = ["搜索引擎":"Google","学习网站":"immoc"] var course2 = Dictionary<Int,String>() var course3 = [:] var course4 = Dictionary<String,String>() courses.count//3 course2.isEmpty//true courses[73]//nil
dictionary可以有isEmpty判断啊