一种明显的方式是这样的:
>>> names = ["Rob","Mark","Steve"]>>> lists = {name: [] for name in names}>>> print lists{'Steve': [], 'Rob': [], 'Mark': []}
欢迎分享,转载请注明来源:内存溢出
一种明显的方式是这样的:
>>> names = ["Rob","Mark","Steve"]>>> lists = {name: [] for name in names}>>> print lists{'Steve': [], 'Rob': [], 'Mark': []}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)