NESTED CONDITIONALS

What are nested conditionals? Answer: Conditionals inside of conditionals!

Why are they useful? Answer: Nested conditionals are useful when you need to check multiple conditions before performing an action. They allow you to create complex logic flows.

Can you think of some examples? Let’s cover them!

PSUEDOCODE

Let’s start nice and simple. We’ll lay out the logic of the nested conditionals using words. The goal is to display number that integers and greater than 1.

if the number entered has a decimal, then it will not be displayed (exit loop)

if the number the number is less than 0, then it will not be displayed (exit loop)

else: display the number on the screen!