Loops (for / while)
Iterating over ranges (1:5) and vectors with for, conditional repetition with while.
Simple enough for a 5-year-old to understand
range with for
The 1:5 range ALSO includes 5.
for (i in 1:3) { cat(i, "\n", sep="")}🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 1
2
3
4
5