I could probably argue that either way. I will first argue that the for
loop is a statement as is the if
and the return
. So there are 3 statements that execute in a sequence.
The opposing argument would be that by definition for
is a single statement that includes a block of code. if
is a single statement that includes a statement. So one statement no matter how you slice it.
One could argue that a for
loop alone is a sequence since the for
loop contains 3 statements all by itself but nobody is listening to that nonsense.
This student can change this to comply with the rubric easily. Use the list reduce pattern. Doing so would probably bring to light a bug.
1 Like