Trying to get dict[k] from a dict in a list of dicts for k in list or string
I have a couple dictionaries with differing values for the same keys.
I have a list of these dicts and I want to return the values from only 1 of the dicts based on the matched keys inside a different list or string.
I want it to reflect the dict with a matching list index as the first str in the other list.
Python: How can I take a list of pairs of items (string, tuple) and add(convert) it to a dictionary?
I have spent hours trying to figure this out, I thought it would be easy! I’m obviously still a beginner at Python. Here is my list:
[‘Kaivopuisto’, (‘24.950292890004903’, ‘60.155444793742276’), ‘Laivasillankatu’, (‘24.956347471358754’, ‘60.160959093887129’), ‘Kapteeninpuistikko’, (‘24.944927399779715’, ‘60.158189199971673’), ‘Viiskulma’, (‘24.941775800312996’, ‘60.16098589997938’), ‘Sepankatu’, (‘24.93628529982675’, ‘60.157948300373846’), ‘Hietalahdentori’, (‘24.929709900391629’, ‘60.162225100108344’), ‘Designmuseo’, (‘24.945959999554361’, ‘60.163103199952786’), ‘Vanha kirkkopuisto’, (‘24.939149900447603’, ‘60.165288299815245’), ‘Erottajan aukio’, (‘24.944134928883898’, ‘60.166911666939939’)]. I need to create a new dictionary with the string(name) as the key and the tuple as the value. For clarification, the string is the name of a city in Finland and the tuple is longitude and latitude for the city. I really could use some guidance please.