Thinking in code · Making decisions

If

An if block lets a program do something only when a condition is true, such as warn when the battery runs low.