fork download
  1. d = {'previous_f_key': {'1g': ['33725.7', '-70.29'],
  2. '2g': ['35613.3', '108.83'],
  3. '3g': ['32080.9', '-69.86']},
  4. 'f_key': {'1g': ['8880.8', '-66.99'],
  5. '2g': ['6942.6', '114.79'],
  6. '3g': ['12300.3', '-70.34']}}
  7.  
  8. def weird_max(d):
  9. vals = []
  10. for item in d.itervalues():
  11. if isinstance(item, dict):
  12. vals.append(weird_max(item))
  13. else: # should be a list
  14. vals.extend(item)
  15. return max(vals, key=float)
  16.  
  17. print weird_max(d)
Success #stdin #stdout 0.08s 8832KB
stdin
Standard input is empty
stdout
35613.3