4 AnswersNew Answer
for instance: sub=6 if sub<5: (1) print("smaller than 5") if sub>3: (2) print("bigger than 3") in here, since the first condition isn't verified, the second one won't be checked.
just a doubt.. thanks for taking it off.
KHADIJA AI Your question is not very clear. If the following explanation is not what you are looking for, then please provide the example for which you have a doubt. x = 5 y = 10 if x > 5 || y < 10: (1) doSomething() if x > 5 && y < 10: (2) doSomething() In (1) if the condition x > 5 fails, then the compiler will check if y < 10, if this is true then function doSomething() will be called. If first condition is true, the second condirion will be not be checked and doSomething function is called. In (2) if the first condition x>5 fails no further condition will be checked, the whole if block will be skipped. If however first condition pass, then second condition will be checked and only if that is true function doSomething will be executed. (1) is called logical OR condition and (2) is called logical AND
KHADIJA AI Yes it will not be checked since second if is inside first if. When the first if fails, the code never enters the if block