想象一下这个对象:
my_obj = {
'Episodes' : [
{'Tags' : ['one','two','three']},
{'Tags' : ['three','four','five']}
]
}
我想创建一组标签:
tags = set(tag for tag in e['Tags'] for e in my_obj['Episodes'])
但是,它不起作用,因为e
没有定义。我该怎么做??