I have long four list , I want to check if a word in list_1 and if that word in list_2 with another string (but that substring is still exist) same for all four list , if that substring exist in all four list then print.
So suppose i have these four list :
a=["1","2","45","32","76"]
b=["5","8","345","32789","43"]
c=["362145","9932643","653"]
d=["194532","5423256","76"]
so i wanted to match 45
,32
in list a and in list b also because 34
5 contain 34 but it also contain 45 345
and 32
789 contain 32 and list c contain 3621[45]
and 99[32]
643 contain 32 and so in list d 19[45]
32 contain 45 and 542[32]
56 contain 32 so if a substring (example 45) is in all 4 list then print.
I tried with "in" method but that doesn't work and then i tried with set() which also doesn't work , How can i do it ?
P.S : is there any method without looping all over list ? because this module is submodule of a large program and that program already contain many loops , if possible without loop otherwise all suggestion welcome :)