<jupyter_start><jupyter_text>While loop<jupyter_code>#Iterate over a block
#Iterate over a sequence
i = 1

while i < 7:
    print(i)
    if i == 4:
        break
    i += 1
i = 1

while i < 7:
    i += 1
    if i == 4:
        continue
    print(i)<jupyter_output>2
3
5
6
7<jupyter_text>For Loop<jupyter_code>#Iterate over a block
#Iterate over a sequence
fruits = ["lemon", "cherry", "banana"]

for x in fruits:
    print(x)
# Looping through a string
for i in "Python":
    print(i)
fruits = ["lemon", "cherry", "banana"]

for x in fruits:
    print(x)
    if x == "cherry":
        break
# using FOR loop with range()
for x in range(7):
    print(x)
for x in range(2, 7):
    print(x)
for x in range(2, 30, 3):
    print(x)
else:
    print("Completed!")<jupyter_output>2
5
8
11
14
17
20
23
26
29
Completed!
{'fraction_non_alphanumeric': 0.12978986402966625, 'fraction_numerical': 0.04573547589616811, 'mean_word_length': 2.894230769230769, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '631995', 'license': 'MIT', 'n_tokens_mistral': 360, 'n_tokens_neox': 336, 'n_words': 111, 'path': 'python/sde-octopus course/Loops.ipynb', 'repo_name': 'natan-dias/study', 'size': '809'}