Latest web development tutorials

python3の辞書項目()メソッド

python3の辞書 python3の辞書


説明

Pythonの辞書項目()メソッドは(キー、値)タプル配列を横断するリストを返します。

文法

アイテム()メソッドの構文:

dict.items()

パラメータ

  • NA。

戻り値

戻り値トラバーサル(キー、値)タプル配列。

次の例では、項目()を使用する方法を示しています。

#!/usr/bin/python3

dict = {'Name': 'w3big', 'Age': 7}

print ("Value : %s" %  dict.items())

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

Value : dict_items([('Age', 7), ('Name', 'w3big')])

python3の辞書 python3の辞書