I have a dictionary with lists:
d1 = {
'frutas': {
' manzanas': [' verdes', ' 7', ' rojas', ' 5'],
'uvas': [' negras', ' 5', ' verdes', ' 3']
},
' verduras': {
'papa': ['negras', ' 50', ' blancas', ' 20'],
'cebolla': [' blancas', ' 30']
},
'cereales': {
' arroz': [' fino',' 600', ' largo', ' 800']
}
}
I would like to be able to show with a function each one of the keys with their respective lists, but without showing the contents of the list. So:
frutas : manzanas, uvas
verduras : papa, cebolla
cereales : arroz
** Detail: d1 is loaded from a file.txt on my pc. The function should serve me for any other dX that loads.