1. Convert list to dictionary
#!/usr/bin/python # -*- coding: UTF-8 -*- i = ['a', 'b'] l = [1, 2] print dict([i,l])
The output of the above example is:
{'a': 'b', 1: 2}
1. Convert list to dictionary
#!/usr/bin/python # -*- coding: UTF-8 -*- i = ['a', 'b'] l = [1, 2] print dict([i,l])
The output of the above example is:
{'a': 'b', 1: 2}