Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Conditional statement and branch?

Ook bekend als: conditional statement · if statement · branch

Definition 17.2 Primary & Middle School Computer Science · Hoofdstuk 17 — Decisions: if and else

A conditional statement, or if statement, runs a block only when a condition is true: if condition: followed by an indented block. It may have an else: followed by a second block, run when the condition is false. Each block is a branch: on each run, at most one branch is taken, and exactly one when there is an else.

An if statement is a fork: the condition sends the program into one of the two blocks, and both roads meet again after them.
An if statement is a fork: the condition sends the program into one of the two blocks, and both roads meet again after them.
Lees in het hoofdstuk →