The dictionary is so far with me? Here's an example:
{hits}: {'Result': [{'key1': 'value1', 'key2': 'value2', 'key3': {' Sub_key ':' 'sub_value'}}, {'key1': 'value3', 'key2': 'value4', 'key3': {'sub_key': 'sub_value2'}}]}} How do I want to get the dictionary all_well each subkey and store it in a different list. It does not matter what I do, I get errors. This was my last attempt:
inner_list = mydict ['hits'] ['result'] # This is an in-index list for the inner_dix index = 0: New_dict [index] = x [u'sub_key '] index = index + 1 print new_dict This first prints some results, then started back to everything in the original dictionary. I can not take my head around it If I change the new_dict [index] with a print statement then it prints completely on the screen, in fact it needs some input! In_list for: print x [u'sub_key ']
Comments
Post a Comment