AtomLearn
DashboardGoalsGraphAchievementsReviewSign In
Programming FundamentalsNot Started

Loops

Repeat actions with for and while loops

0%

Knowledge Debt detected

You can study this freely — but your score may plateau if these foundations have gaps. The Mastery badge requires them to be solid.

Explanation

Loops let you repeat code without writing it multiple times.

for loop — iterate over a sequence: ``python for i in range(5): print(i) # 0, 1, 2, 3, 4

while loop — repeat while a condition is True: ``python count = 0 while count < 3: print(count) count += 1

break exits the loop early. continue skips to the next iteration.

Examples

Iterating a list

Loop through a list and transform each item

fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
    print(fruit.upper())

Next in Programming Fundamentals

Conditionals

Continue