If Expression

The if expression evaluates a condition and executes code based on the result:

 if (eq(x, 1)):
   "one"
 elif (eq(x, 2)):
   "two"
 else:
   "other"

The if expression can be nested and chained with elif and else clauses. The conditions must evaluate to boolean values.