Codele / Programming basics
If and else
So far every line ran, top to bottom. Now the computer asks a yes or no question and picks one of two paths.
- if asks a yes or no question. Yes: run the lines inside it.
- else is the other path. It runs only when the answer is no.
- Exactly one path runs. Never both, never neither.
- Lines after the if and else run either way.
- >= means “at least”: bigger than or equal to.
Loading the playable lesson…