Python3 code to demonstrate working of


Topic: Python3 code to demonstrate working of

Solution

  
test_dict = {1: 6, 8: 1, 9: 3, 10: 8, 12: 6, 4: 9} 
  
  
K = 2
  
test_dict = list(test_dict.items()) 
  
res = [test_dict[(i - K) % len(test_dict)] 
       for i, x in enumerate(test_dict)] 
  
res = {sub[0]: sub[1] for sub in res} 
  
print("The required result : " + str(res)) 



List all Python Programs