conditional expression

noun
UK /kənˈdɪʃənəl ɪkˈspreʃən/
US /kənˈdɪʃənəl ɪkˈspreʃən/

A conditional expression is a way to choose one thing or another based on whether something is true.

In the code, the conditional expression picks a smiley face if the score is high and a sad face if it is low.


OTHER MEANINGS

2. In programming, a compact syntax like 'a if condition else b' that returns one of two values.

The conditional expression x if x > 0 else -x gives the absolute value of x.

3. In logic and mathematics, a statement of the form 'if P then Q'.

The conditional expression 'if it rains, then the ground is wet' links two propositions.

4. In grammar, a clause or phrase that expresses a condition, often starting with 'if'.

The sentence 'If you hurry, you will catch the bus' contains a conditional expression.