Imagine this object:
my_obj = {
'Episodes' : [
{'Tags' : ['one','two','three']},
{'Tags' : ['three','four','five']}
]
}
I want to create a set of the tags:
tags = set(tag for tag in e['Tags'] for e in my_obj['Episodes'])
However, it doesn’t work because e is not defined. How can I do it??
you need to change the order and get e first… 🙂