Not Yet Observed
ElseAlwaysExecutes
Incorrect
The else branch of an if-then-else block always executes
Correct
The else branch of an if-then-else block only executes if the condition evaluates to false
CorrectionHere is what's right.
Here is what's right.
In an if-then-else
block, only one of the two branches executes.
Simple Example
With the following script, the sprite will either say “a” or it will say “b”. This means it will not always say “b”.
The following script is different. The sprite will either say “a” immediately followed by “b”, or it will say “b”. This means it will always say at least “b”:
More Complex Example
is different from
OriginWhere could this misconception come from?
Where could this misconception come from?
NOTE — We are not aware of repeated observations of this misconception in Scratch. We documented it, for completeness, based on observations of an equivalent misconception in other languages.
Language
Scratch