标签:div code span 通过 name rom nbsp lex bsp
l1 = [1,1,2,3,5,5,4,4,4,5,6] set1 = set(l1) # print(set1) # set是集合 l2 = list(set1) # 将集合转换成列表 print(l2) #[1, 2, 3, 4, 5, 6]
# (1)直接创建 dic1 = {‘name‘:‘alex‘,‘age‘:28,‘sex‘:‘M‘} # (2)fromkeys()创建 dic = dict.fromkeys([1,2,3],‘alex‘) print(dic) # (3)通过 dic = dict({‘name‘:‘alex‘,‘age‘:28,‘sex‘:‘M‘}) print(dic)
标签:div code span 通过 name rom nbsp lex bsp
原文地址:https://www.cnblogs.com/youhongliang/p/9457425.html