copy
dict.fromkeys
in 연산자
キーのイテラブルから新しいディクショナリを作成します。
dict.fromkeys(iterable, value?)
아래 값을 입력하면 예제에 즉시 반영됩니다.
keys
dict
fromkeys
print
keys = ["a", "b", "c"] d = dict.fromkeys(keys, 0) print(d) # {'a': 0, 'b': 0, 'c': 0}