Skip to content

The Powerful Else Keyword

The Powerful Else is Python#

So in python you can use else after a for loop:

For Loop#

    for item in my_list:
        new_list.append(item)
    else:
        # Come to the end and we do this
        # like a finally
        ...

Try…Except…Else#