K
K
Kirill2018-04-15 14:52:18
Python
Kirill, 2018-04-15 14:52:18

How to make a dictionary with keys from list and values ​​0?

a = ['i', 'was', 'three', 'near']
Dict = {}

result 
Dict = {
        'i': 0,
        'was': 0,
        'three': 0,
        'near': 0
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
planc, 2018-04-15
@PainMain

Dict = {i: 0 for i in a}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question