Open dvas0004 opened 4 years ago
It's possible to generate a dictionary using comprehensions:
t = ["1", "234", "45"] a = { keyName: len(keyName) for keyName in t } print(a) # prints: {'1': 1, '234': 3, '45': 2}
It's possible to generate a dictionary using comprehensions: