Conditional Expression

This lesson explains what conditional expressions are, how to use them and their basic syntax using an example

We'll cover the following

There are expressions of a special kind, the conditional expressions, these are not statements, but they are one sort of contraction of the if-then construct.

This kind of expression can help to produce highly readable assignment statements fitting onto one line of the source code.


This is the syntax:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy