Here is how to do dictionary comprehension in Python.
words = ['be', 'is', 'are']
word_length = {word: len(word) for word in words}
print(word_length)
Output
{'be': 2, 'is': 2, 'are': 3}
Explanation
A dictionary comprehension is a code expression that constructs a dictionary out of an original object. In this case, the original object is a list. The dictionary comprehension is constructing a dictionary that contains (1) the items of the list as keys and (2) the length of those items (i.e., number of characters) as value.