I am a Python beginner and am struggling with working with dictionaries.
I have the dictionaries routesAndID and findOutPlane:
routesAndID = {('Sydney', 'Dubai'): 3, ('New York', 'Los Angeles'): 2, ('Zurich', 'Singapore'): 0}
findOutPlane = {('Sydney', 'Dubai'): 'Airplane', ('New York', 'Los Angeles'): 'Helicopter', ('Zurich', 'Singapore'): 'Jet'}
I need to extract the Aircraft and the corresponding ID on match of routes (depending on routes, the aircraft can be identified). I need the following output:
newdict = { "Airplane": 3, "Helicopter": 2, "Jet": 0 }
Would anyone know how to do so?