Replit
Try Python exercises in a browser coding workspace.
Free and paid plans; usage limits and feature availability vary.
Explore toolLesson 2 of 3 · 10 min
A for loop repeats code for each item: for day in days: print(day).
A while loop repeats until a condition becomes false — always make sure it can end.
Print the numbers 1 to 10 with a for loop, then again with a while loop.
Optional resources
No purchase or partner signup is required to complete this course or earn quiz points.
These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.
Try Python exercises in a browser coding workspace.
Free and paid plans; usage limits and feature availability vary.
Explore tool