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.
I tried list comprehension, I tried a for loop, I tried the update method – I can’t get anything to work.
John Fox is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.