python - using a dictionary to cut down a list of tuples -


I am trying to use a dictionary to reduce a list of tuples, the starting point is shown below I have also included a dictionary - the dictionary has the values ​​that I am trying to use to cut the list of my tuples

  start = [('Brian', ' ('David', 'Lucy')] DIC = {'Brian': 4.9, 'Lucy': 7.5, 'David': 8.0}   

( In the case of the dictionary, the value should be removed) In this case the desired output will be

  [('David', 'Lucy']]   

B / C The full value of David - Lucy = 0.5

Try my (unsuccessfully) to solve my problem in the category (0, Lane (start))

  end = []: If stomach (DIC [Start [I] [0]] - DIC [Start [I] [1]]) & Lt; 1.0001: End. Any help would be greatly appreciated   

= "Text">

Understanding a list can help you.

  for e (o, o) o -1 if at first -1 if the lt; Dyke [E] -dic [o] & lt; 1]    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -