why for loop print only once after add if statement

meInvent bbird jobmattcon at gmail.com
Sat May 28 08:31:30 EDT 2016


thanks, i discover that i misunderstand i and item,

they should be swapped

On Saturday, May 28, 2016 at 6:19:23 PM UTC+8, meInvent bbird wrote:
> for item, i in enumerate(aa)
>   print item
> 
> this writing, it can print all values
> 
> for item, i in enumerate(aa)
>   if item == findit:
>     print item
> 
> this only print the first value, means it only print once then not print again,
> 
> where is wrong?




More information about the Python-list mailing list