if Statements | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

if Statements

Hello, In an If Statement, if the first condition is not true, so all other conditions that follow it are not. Isn't it?

7th Jul 2019, 12:18 PM
KHADIJA AI
KHADIJA AI - avatar
2 Answers
+ 2
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.
7th Jul 2019, 1:03 PM
KHADIJA AI
KHADIJA AI - avatar
+ 2
just a doubt.. thanks for taking it off.
7th Jul 2019, 1:59 PM
KHADIJA AI
KHADIJA AI - avatar