I need advice about comprehensions. Got TypeError: unhashable type: 'list' but I can't see any list coming. (Trying to get dict of indexes and lengths)
data = (
'abcdefg',
(10, 20, 30, 40, 50),
(55,81, 33, 44)
)
# TODO from this:
# lens = dict()
#
# for el in enumerate(data):
# lens[el[0]] = len(el[1])
# TODO to this
lens = {[el[0]]: len(el[1]) for el in enumerate(data)}
print(lens)