4. if
/ else
ΒΆ
What to do when the
if
condition is false?.The
else
clause means otherwise.It is usually used to indicate complementary conditions.
The if / else conditions can be seen as a car arriving at a fork in the road.
Depending on the result of a condition, the car can take the upper or lower road.

The two codes below do the same thing but one uses if / else conditions.
Activity: CodeLens 4.1 (cl_l10_4a_en)
Activity: CodeLens 4.2 (cl_l10_4b_en)
You have attempted of activities on this page