Double for loop in a dictionary in python -


I have 1 dictionary with the key of N. I want to go through this dictionary with a double for loop so that I do not take two elements at the same time (from Kashmir 1 to N-1 and Jammu to Kashmir + 1 to N). I need this skill because I have to repeat this operation. Is there any understanding of a dictionary so that the keys can be obtained: From Kashmir 1 to N-1 and Jammu to Kashmir + 1 to N?

If the sequence of keys does not matter, you can do this

< (My_dict.): In the key 2 combinations, importing combinations for key 1 from iTROOTO (my_dict. Keys (), r = 2): print key1, key2

output

  acabadcbcdbd  

Comments