Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Conditional statement and branch?

Dikenal juga sebagai: conditional statement · if statement · branch

Definition 17.2 Primary & Middle School Computer Science · Bab 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.
Baca dalam konteks →