10.有字符串 "k:1|k1:2|k2:3|k3:4" 处理成字典 {'k':1,'k1':2....} s = "k:1|k1:2|k2:3|k3:4" dic = {} l1 = s.split('|') for i in l1: k,v = i.split(':') dic[k] = v print(dic)…
检查获取传入列表或元组对象的所有奇数位索引对应的元素,并将其作为新列表返回给调用者. li = [11,22,33,44,55,66,77,88,99,000,111,222] def func1(lst): new_li = [] for i in range(0,len(lst),2): new_li.append(lst[i]) return new_li print(func1(li))…