Python Exercise Example 100
**Question:** Convert a list to a dictionary.
**Analysis:** None.
Program source code:
Example
#!/usr/bin/python
-- coding: UTF-8 --
i
=
[
'
a
'
,
'
b
'
]
l
=
[
1
,
2
]
dict
(
[
i
,
l
]
)
The output of the above example is:
{'a': 'b', 1: 2}
Python 100 Examples