Friday, 15 March 2013

python - Combining keys and values of two different dicts -


I am new to Python and am trying to merge two decants

  D1 = '' A ':' 1 ',' B ':' 2 ',' C ':' 3 ',' D ':' 4 ',' E ':' 5 '} d2 = : '!' , 'Y': '@'}  

I am trying to merge the keys of both rules so that the result will look like this:

  D3 = {'A_X': '1!', 'B_X': '2!', 'C_X': '3!', 'D_X': '4!', 'E_X': '5!', ' '@ 1', 'b_yy': '2 @', 'c_yy': '3 @', 'D_Y': '4 @', 'E_Y': '5 @',}   
  d3 = {pre class}  

< P> One more secret but doing this Dragon Way area: <2 p2 }

No comments:

Post a Comment