not-in-loop / E0103ΒΆ

Message emitted:

%r not properly in loop

Description:

Used when break or continue keywords are used outside a loop.

Problematic code:

def print_even_numbers():
    for i in range(100):
        if i % 2 == 0:
            print(i)
    else:
        continue  # [not-in-loop]

Correct code:

def print_even_numbers():
    for i in range(100):
        if i % 2:
            continue
        print(i)

Created by the basic checker.