0
What does the following code denote about index updation?

Open 1 Answers 47 Views Technology

What does the following code denote about index updation?

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

1 Answer

0
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.
by (305k points)
...