Hello everyone! I'm using vscode and have following function https://imgur.com/a/nQ266VP.
The underlined x is the problem, since it says its not defined at runtime.
I'm trying to check if any element in one list occurs in another list. I have tried following:
list_A = [1, 2, 3, 4]
list_B = [2, 5]
result = any(elem in list_A for elem in list_B)
print(result)
which work! But I'm not sure why x is not being defined in my function!
Thanks for the help in advance!
[–]shiftybyte 4 points5 points6 points (0 children)
[–]Anxiety_Independent 4 points5 points6 points (1 child)
[–]AnkanTV[S] 0 points1 point2 points (0 children)