Loop - while

PHOTO EMBED

Mon Sep 16 2024 13:13:44 GMT+0000 (Coordinated Universal Time)

Saved by @jerseyitguy #python

# Using a while loop
sum_numbers = 0
num = 1

while num <= 100:
    sum_numbers += num
    num += 1

print(f"Sum of numbers 1 to 100: {sum_numbers}")
content_copyCOPY