<jupyter_start><jupyter_text>Flow ControlPython supports conditional logic and "branching" so "non-sequential" execution of commands are possible. There are two (2) types of iterations (or loops) available.<jupyter_code>jack = ['work', 'work', 'work']<jupyter_output><empty_output><jupyter_text>While_while_ is discussed here.<jupyter_code>dull = True
jackLength = len(jack)
jackLength
index = 0<jupyter_output><empty_output><jupyter_text>The "code block" is repeatedly executed until the terminitating condition becomes _True_.  Generally, an iterator is "advanced" for it to end - otherwise, it will become an "infinite loop" and run indefinitely if it is not interrupted (i.e. either manually stopped by the programmer or until it uses up all the computing resources).  _index_ (or _i_ for short) as the iterator since a loop is typically used to access the contents of an _array_ element<jupyter_code>while (index < jackLength):
    if (jack[index] == 'work'):
        pass
    else:
        dull = False
    index += 1<jupyter_output><empty_output><jupyter_text>_pass_ is equivelent to "no-op" where no action is taken - the _if_ could have been written the "opposite" way but would not have been able to illustrate this statement.<jupyter_code>print('Index: ', index, "Dull: ", dull)
jack2 = ['play']
jack += jack2
jack
index2 = 0
jackLength2 = len(jack)
while (index2 < jackLength2):
    if (jack[index2] != 'work'):
        dull = False
    index2 += 1
print('Index: ', index2, "Dull: ", dull)<jupyter_output>Index:  4 Dull:  False<jupyter_text>Note:  _index_ was substituted with _index2_ and _jackLength_ with _jackLength2_ so that the loop would act as expected.  Also. the _if_ statement was rewritten.<jupyter_code>index2 = 0
while (index2 < jackLength2):
    if (jack[index2] == 'work'):
        print("Whistle! \n")
    index2 += 1
current = 1
maximum = range(1, 4, 1)
while (current in maximum):
    print('Current: ', current)
    current += 1<jupyter_output>Current:  1
Current:  2
Current:  3
{'fraction_non_alphanumeric': 0.10144206862257583, 'fraction_numerical': 0.015912481352560914, 'mean_word_length': 4.69971671388102, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 19, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '489287', 'license': 'MIT', 'n_tokens_mistral': 654, 'n_tokens_neox': 631, 'n_words': 230, 'path': 'FlowControl/While.ipynb', 'repo_name': 'LinsAbadia/Python', 'size': '2011'}