How do you miss the dict ?



  • I'm going through the loop. If there's a word of hello, I want to miss the next two keys to the dictionary. How do you do that?

    for key, value in enumerate(mydict):
       if value='Привет':
          next(mydict) #что то типа такого
          next(mydict) #
    


  • mydict = {"7": 0, 8:0, 5:"Привет", 9:0}
    
    it = iter(mydict.items())
    for key, value in it:
       print(key, value)
       if value == 'Привет':
          next(it, None) #что то типа такого
          next(it, None) #
    

Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2