Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Conditional statement and branch » ?

Aussi appelé : conditional statement · if statement · branch

Definition 17.2 Primary & Middle School Computer Science · Chapitre 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.
Lire dans le chapitre →