python实现创建新列表和新字典,并使元素及键值对全部变成小写

如下所示:

lists = ['tom','Jack','luCy','lily','jErry','anna']
dics = {'jack':'python','Lucy':'jaVa','jeRry':'rUby','lily':'c#',}



new_lists = []
for i in lists:
	new_lists.append(i.lower())
print(new_lists)



new_dics = {}
for i,j in dics.items():
	new_dics[i.lower()] = j.lower()
print(new_dics)

相关推荐