3.7 Nested Conditionals

2 阅读1分钟

1. Exam Points

  • Predict output of nested conditional statements.
  • Select the correct algorithm(s) based on a scenario given.
  • Determine which part (if or else) of a given algorithm is executed.

2. Knowledge Points

(1) Nested Conditionals

  • Nested conditional statements consist of conditional statements within conditional statements.
  • You can nest any of the following conditional statement in another.
    • if
    • if...else
  • Example:
    • if in if
      image.png
    • if...else in if or else
      image.png image.png

3. Exercises