I have some variables A and B and I want to check them for a value and if both are False, the function shall render True:
if ( A == 1 and B == 2 ) == False :
do magic
I breaks down if either A or B is not defined and when I test it with
print(A == 1 and B == 1)
this breaks with an error:
IndexError: list index out of range
A or B are actually some variables from web-API and this whole thing runs in a loop, constantly checking and can be either set or not set with a value.
Is there a way to ignore whether A or B is defined or yield a default FALSE if not defined/existing?