摘要: 1 #dict字典 2 #dict是一种没有顺序的组合数据,数据以键值对的形式出现 3 #一、创建dict 4 #1、创建空dict 5 d = {} 6 print(d) 7 d = dict() 8 print(d) 9 #2、创建带值的dict 10 d = {"one":1, "two":2} 11 print(d) 12 d = dict({"... 阅读全文
posted @ 2018-09-10 17:12 美滋滋的胖虎 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1 #集合 2 #一、概念:参照高中数学,一堆确定的无序的唯一数据,没有重复 3 #1、创建set两种方法 4 s = set() 5 print(type(s),s) 6 s = {1, 2, 3} #大括号内一定要有值 7 print(type(s),s) 8 #二、集合特征 9 #1、因为集合内部数据无序,所以无法使用索引和切片 10 #2、合内部数据... 阅读全文
posted @ 2018-09-10 15:25 美滋滋的胖虎 阅读(222) 评论(0) 推荐(0) 编辑