> `while i < len(c)` instead of `while 1`
> 

hi, 
 
i modified codes to be i<len(c) but it still goes into the except part. tq
 
c=('01101')
i=-1
try:
    while i<len(c):
        i=c.index('0',i+1)
        print "Lane fail",i        
except ValueError:    
    print "All Lanes PASS"
    pass
 
Result:
>>> 
Lane fail 0
Lane fail 3
All Lanes PASS
>>> 
 
                                          
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to