Q:

printing even numbers with lists and brackets

When I run the following code for some reason it says that the break is incorrect but works if I delete the break. 
Can anyone help me to understand why?
composites = []
for i in range(101):
    for j in range(i):
        if (i % j) == 0:
            composites.append(i)
            break
print("Composites: ", *composites)

A:

The sample code provided threw a ZeroDivisionError instead of a break error. Problem is with the second range as the modulo function cannot be done with 0.  
Since composites are non-prime numbers, factors checking should start from 2. Changing the second range function to range(2, i) should solve this.     
composites = []
for i in range(101):
    for j in range(2, i):
        if (i % j) == 0:
            composites.append(i)
            break
print("Composites: ", *composites)

