This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Sometimes we need a conditional that evaluates more than one expression. For example: maybe I want to match a range of numbers like 10 through 1000. We need to do two tests -- is the number greater than or equal to 10 AND is the number less than or equal to 1000? In this video we'll look at how to nest conditional statements.
Express Yourself
Have you ever found yourself using the same word to express yourself in conversation? For example:
'Programming is kewl'
'Bungee jumping is kewl'
'My vacation was kewl'
While there is nothing technically WRONG with these sentences, the concept being conveyed is not clear. You could be more descriptive by saying:
'Programming is stimulating'
'Bungee jumping is thrilling'
'My vacation was relaxing'
These sentences give a much clearer description of the concept being conveyed. In the same way, you can get comfortable using equality conditionals and force your code to fit into that syntax, even though you may actually mean identical or even NOT equal. Try to use the expression that most clearly defines what your code should actually be doing.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up