```
>>> a = [4, 8, 10, 11, 12, 15]
>>> for x in a[:]:
if x % 2 == 0:
a = a[1:]
else:
break
>>> print (a)
[11, 12, 15]
>>>
```

Looks like we need to break out of the loop when we find an odd number.

Interesting that above we keep the loop going while `x`

is divisible by two. Can we write logic that is explicit about this, rather than using `for`

?

Yes.

```
>>> a = [4, 8, 10, 11, 12, 15]
>>> while a[0] % 2 == 0:
a = a[1:]
>>> a
[11, 12, 15]
>>>
```

Now we are not iterating a list, as such, just focusing on the first element of the list. Mutation is part and parcel of iteration.

Warning: This one will throw an error on an empty list.

```
>>> a = [4, 8, 10, 14, 12, 16]
>>> while a[0] % 2 == 0:
a = a[1:]
Traceback (most recent call last):
File "<pyshell#28>", line 1, in <module>
while a[0] % 2 == 0:
IndexError: list index out of range
>>> a = []
>>> while a[0] % 2 == 0:
a = a[1:]
Traceback (most recent call last):
File "<pyshell#31>", line 1, in <module>
while a[0] % 2 == 0:
IndexError: list index out of range
>>>
```

The `for`

loop protects us from that exception.

```
>>> a = [4, 8, 10, 14, 12, 16]
>>> for x in a[:]:
if x % 2 == 0:
a = a[1:]
else:
break
>>> a
[]
>>> for x in a[:]:
if x % 2 == 0:
a = a[1:]
else:
break
>>> a
[]
>>>
```

What if…

We just return the slice that starts at the first odd number?

```
>>> a = [4, 8, 10, 11, 12, 15]
>>> for x in a:
if x % 2 != 0:
a = a[a.index(x):]
break
else:
a = []
>>> a
[11, 12, 15]
>>> a = [4, 8, 10, 14, 12, 16]
>>> for x in a:
if x % 2 != 0:
a = a[a.index(x):]
break
else:
a = []
>>> a
[]
>>>
```