Python組み込み関数dict
set

dict組み込み関数

open

ディクショナリを生成します。

構文

dict(**kwargs)

使用例

下記の値を入力するとサンプルに即時反映されます。

dict
name
print
pairs
d = dict(name="Alice", age=30)
print(d)  # {'name': 'Alice', 'age': 30}

pairs = [("a", 1), ("b", 2)]
print(dict(pairs))  # {'a': 1, 'b': 2}