Pattern matching using python -


How to match the dictionary after "answer" and "nonanswer" in the word below

  opt_dict = ({'answer1': 1, 'answer13': 12, 'answer11': 6, 'answer5': 5, 'nonanswer12': 1, 'nonanswer11': 1, Opt_dict : Ii opt_dict: logging.debug (ii) for logging if opt_dict: if, 'nonanswer4': 1, 'nonanswer5': 1,})  

and

 

I have all your Logging But this should work:

  if opt_dict: value in opt_dict.items () for the key: If the key "nonanswer": Print "Answer", print the "Answer" key in Alif : Print "Answer", Other Value: Increase exception ("Invalid key") Other: Print "blank word"  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -