in Technology by

What does the following code denote about index updation?

for (index in 1:3) {
index <- index * 2
print(index)
}

Please log in or register to answer this question.

1 Answer

0 votes
by

In a for-loop the index is updated at the beginning of each iteration. Therefore, reassigning the index symbol during one iteration doesn’t affect the following iterations.

Related questions

...