Latest web development tutorials

Pythonは演習100と、

Pythonの100リー Pythonの100リー

トピック:辞書にリスト。

プログラム解析:なし。

ソースコード:

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

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

上の例の出力は、次のとおりです。

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

Pythonの100リー Pythonの100リー