Loops (for / while)
for-in with ranges (1...5), iterating over arrays, and conditional repetition with while.
Simple enough for a 5-year-old to understand
range with for
1...5 is a closed range (includes 5). 1..<5 does not include 5.
for i in 1...3 { print(i)}🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)
🎯 Expected output: 1
2
3
4
5