words = ['be', 'is', 'are']
word_length = {word: len(word) for word in words}
print(word_length)
{'be': 2, 'is': 2, 'are': 3}
Learn Flask development and learn to build cool apps with our premium Python course on Udemy.
Subscribe to be the first to know when a new Python course is released.