Latest web development tutorials

Python includes exercises 100

Python 100 Li Python 100 Li

Topic: list into the dictionary.

Program Analysis: None.

Source Code:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

i = ['a', 'b']
l = [1, 2]
print dict([i,l])

The above example output is:

{'a': 'b', 1: 2}

Python 100 Li Python 100 Li