两个集合求交集
check_set_list = ['zheng','xinying','zhang']
>>> sample_set_list = ['xinying','zhangchunmei','zhiwu']
>>> check_set_list & sample_set_list # &求交集必须对集合进行操作
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for &: 'list' and 'list'
>>> set(check_set_list) & set(sample_set_list)
{'xinying'}
大步走,一路向前,一路欢歌。