I have come across a strange behavior using the python break statement within a try-except block. 

```
i=0
lst=[]
while i < 5:
    try:  
        if i < 3:
            raise Exception('spam', 'eggs')
        #lst[0]=i
        print('-'+str(i)+'-')
        break
    except:
        i=i+1
        print(str(i)+' ',end='')

```

> 
> 1 2 3 -3-
> 
> 
> 

But if I remove the commented line:

```
i=0
lst=[]
while i < 5:
    try:  
        if i < 3:
            raise Exception('spam', 'eggs')
        lst[0]=i
        print('-'+str(i)+'-')
        break
    except:
        i=i+1
        print(str(i)+' ',end='')

```

> 
> 1 2 3 4 5
> 
> 
> 

Why has the list assignment caused the break to no longer happen? Can someone explain what is going on here.