Beginner R
Q26 / 100

Which loop construct repeats a block of code for each element in a vector?

Correct! Well done.

Incorrect.

The correct answer is A) for (i in vec) { ... }

A

Correct Answer

for (i in vec) { ... }

Explanation

"for (variable in sequence) { body }" iterates the variable over each element of the sequence.

Progress
26/100