I want to write a statement like this javascript in Python:
if (variable1 && variable2) {
// do something only if both variables exist
}
I'm trying:
if not (variable1 and variable2) is None:
# do something only if both variables exist
but it isn't working...when I debug, variable 2 is not defined but the function still tries to run. What's going wrong?