I'm trying to write the following piece of code as part of a bigger script (I don't think the rest of the script is relevant for this particular question, but let me know if it is!):
if A and B in C:
print("Ok!")
The problem I'm encountering is that the string "Ok" is printed not when both conditions are met (if A and B in C
) but also when just one of them happens, that is, "Ok" is printed even when only A is in C but B is not.
Any ideas about what I might be missing?
Thanks!