python - Skipping to Next item in Dictionary -


when iterating through dictionary, want skip item if has particular key. tried mydict.next(), got error message 'dict' object has no attribute 'next'

for key, value in mydict.iteritems():     if key == 'skipthis':         mydict.next()     # others complicated process 

i using python 2.7 if matters.

use continue:

for key, value in mydict.iteritems():     if key == 'skipthis':         continue 

also see:


Comments

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -