>>> dic = {'33950850R': ['ALFONSO JOSE CATALA CAJA', 'VIC', 33, 43522], ... '36517855Z': ['HUGO BERROJO CASITAS', 'MATARO', 33, 54376], ... '37383015U': ['GERARD COLOMER LAZARO', 'MATARO', 42, 48453], ... '46770197K': ['FRANCESC XAVIER BARBERAN ZAVALA', 'MANRESA', 27,63931], ... '43436441N': ['MIGUEL BARCELO ALARCÓN', 'GRANOLLERS', 36, 77932], ... '40446681H': ['JOSE MIGUEL GIL QUER', 'BARCELONA', 47, 45280], ... '52405618J': ['VERONICA BORRUEL SANAHUJA', 'MATARO', 37, 62910], ... '33947100B': ['ROBERTO JAVIER CASAJOANA PIÑOL', 'GRANOLLERS', 37, 58152], ... '38145526G': ['JAIME GARRIGA DEL RIO', 'VIC', 28, 70356], ... '33946091A': ['LAURA MOLINA RAMOS', 'BARCELONA', 37, 50724]} >>> df = finanzas(dic) >>> if df != {'VIC': 113878, 'MANRESA': 63931, 'MATARO': 165739, ... 'GRANOLLERS': 136084, 'BARCELONA': 96004}: ... print(df)