Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Conditional statement and branch?

Também chamado de: conditional statement · if statement · branch

Definition 17.2 Primary & Middle School Computer Science · Capítulo 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.
Ler no capítulo →