- names = ['Alice', 'Beth', 'Ceil', 'Dee-Dee', 'Earl']
- numbers = ['2341', '9102', '3158', '0142', '5551']
- phonebook = dict(zip(names, numbers))
- print phonebook
分类
python中如何将两个list合并成一个dictionary? 转http://bbs.pythontab.com/thread-656-1-1.html
阅读(784) 评论(0)