python中如何将两个list合并成一个dictionary? 转http://bbs.pythontab.com/thread-656-1-1.html

python学习网 2017-08-09 22:43:04
  1. names = ['Alice', 'Beth', 'Ceil', 'Dee-Dee', 'Earl']
  2. numbers = ['2341', '9102', '3158', '0142', '5551']
  3. phonebook = dict(zip(names, numbers))
  4. print phonebook
阅读(784) 评论(0)