I have list_a and string_tmp like this
list_a = ['AA', 'BB', 'CC']
string_tmp = 'Hi AA How Are You'
I want to find out is there any of string_tmp items in the list_a, if it is, type = L1 else type = L2?
# for example
type = ''
for k in string_tmp.split():
if k in list_a:
type = 'L1'
if len(type) == 0:
type = 'L2'
this is the real problem but in my project, len(list_a) = 200,000 and len(strgin_tmp) = 10,000, so I need that to be super fast
# this is the output of the example
type = 'L1'
typeas variable name, that's a python builtin method