Dec-27-2020, 03:51 AM
Dictionaries need key/value pairs, so you can either make up a new key, or you can use one of the keys from the dictionaries. Larz60+ created a new key. Below the 'Dia' value is used as a key for each of the sub-dictionaries.
combined_dict = {'qua':{'Promo': 'João', 'Loja': 6697}, 'qui':{'Promo': 'João', 'Loja': 5599}, 'sex':{'Promo': 'João', 'Loja': 7437}}You could also use the values for 'Loja' as the key for your sub-dictionaries. You cannot use 'Promo' values as a key for sub-dictionaries because the 'Promo' values are not unique.