IF LENGTH( password ) < 8:

PRINT ("Your password is not valid!")

This code uses:
IterationSequencingSelection

1 answer

The provided code snippet demonstrates selection.

Here's a breakdown of the code:

  • Selection: This involves making decisions based on conditions. In this code, the condition being evaluated is whether the length of the password is less than 8. If the condition is true, the program executes the PRINT statement.

In contrast:

  • Iteration: This refers to looping through a set of statements until a certain condition is met (e.g., using loops like for, while).

  • Sequencing: This is the execution of code statements in a linear fashion, one after the other.

Since the code evaluates a condition and takes action based on the result, it primarily uses selection.