incrementing key,value pair inside for loop iterating over dictionary
Question: How can I increment key value pair inside a for loop while iterating over
dictionary in python?

    
    
    for key,value in mydict.iteritems(): 
        if condition:
            #inc key,value
        #something to do
    

I have tried using `next(mydict.iteritems())` and `mydict.iteritems().next()`
but in vain.

I am using python2.7.

EDIT - I know that forloop automatically increments the key,value pair. I want
to manually increment to next pair ( Thus resulting in 2 increments). Also I
can't use continue because I want both the key value pair to be accessible at
same time. So that when I increment, I have the current key value pair as well
as the next. If I use continue, I lose access to current and only get next
key,value pair.


Answer: If you need simultaneous access to two key-value pairs use pairwise from
[itertools recipes](https://docs.python.org/2/library/itertools.html).

    
    
    from itertools import izip, tee
    
    def pairwise(iterable):
        "s -> (s0,s1), (s1,s2), (s2, s3), ..."
        a, b = tee(iterable)
        next(b, None)
        return izip(a, b)
    

