4.1.3
Nested conditions (4.1.3) is a Class 10 Computer Science lesson for the Punjab boards. It walks through the idea in plain steps, then sets a short check, in English, Urdu or Roman Urdu.
Your guide: Miss HiraExplains computers with chai, cricket and your phone.
Chapter 1 of every subject is free. Unlock every chapter of this class with the full course.
Unlock full courseAlready paid? Sign in with the Google account you paid with.
A nested if is an if inside another if. The inner test is checked only when the outer condition is True.
Book example: weather = "rainy", temperature = 10. Rainy and below 15 prints Wear a raincoat; rainy but not cold prints Take an umbrella; not rainy prints Enjoy your day!
Python also offers elif (else if) to test several conditions in a row; the exercise uses it although the chapter does not teach it.
Step 1 / 1
A nested if is an if inside another if. The inner test is checked only when the outer condition is True.
Book example: weather = "rainy", temperature = 10. Rainy and below 15 prints Wear a raincoat; rainy but not cold prints Take an umbrella; not rainy prints Enjoy your day!
Python also offers elif (else if) to test several conditions in a row; the exercise uses it although the chapter does not teach it.
Outer if first; the inner if is only reached when the outer one is True.
Found a mistake? Tell us the lesson and the line at exciting@boringeducation.com.
No ads. Tell us what to fix.