SHARE
TWEET

Untitled

a guest Jul 12th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dict1 = {'a' :{'irrelevant': 1}, 'b' :{'cat': 2}, 'c': {'train': 3}}
  2.      dict2 = {'a2' : 4, 'b2' : 5, 'd2': 10}
  3.  
  4.      multiplied_values = []
  5.  
  6.      for key, value in dict1:
  7.            for k, v in value:
  8.                for key2, value2 in dict2:  
  9.  
  10.                    if key == str(key2.split('2')[0]):
  11.                           multiplied_values.append(v*value2)
  12.      print(multiplied_values)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top