title: How to add the values in a dictionary with a condition?
body: <p>Here I have a dictionary of multiples stocks, where I have a token number as the main key.</p>
  
  <pre class="lang-py prettyprint-override"><code>
     {14350850: {'name': 'ACC19DEC1360CE', 'Strike': 1360, 'LTP': 87.85}, 
      14351106: {'name': 'ACC19DEC1360PE', 'Strike': 1360, 'LTP': 1.2}, 
      14351362: {'name': 'ACC19DEC1380CE', 'Strike': 1380, 'LTP': 74.0}, 
      14351618: {'name': 'ACC19DEC1380PE', 'Strike': 1380, 'LTP': 0.95}, 
      14351874: {'name': 'ACC19DEC1400CE', 'Strike': 1400, 'LTP': 60.55}, 
      14352130: {'name': 'ACC19DEC1400PE', 'Strike': 1400, 'LTP': 1.7}, 
      22655746: {'name': 'TATACHEM19DEC450CE', 'Strike': 450, 'LTP': 0.0}, 
      22656002: {'name': 'TATACHEM19DEC450PE', 'Strike': 450, 'LTP': 0.0}, 
      22656258: {'name': 'TATACHEM19DEC460CE', 'Strike': 460, 'LTP': 0.0}, 
      22656514: {'name': 'TATACHEM19DEC460PE', 'Strike': 460, 'LTP': 0.0}, 
      22656770: {'name': 'TATACHEM19DEC470CE', 'Strike': 470, 'LTP': 0.0}, 
      22657026: {'name': 'TATACHEM19DEC470PE', 'Strike': 470, 'LTP': 0.0}, 
      22657282: {'name': 'TATACHEM19DEC480CE', 'Strike': 480, 'LTP': 0.0}, 
      22657538: {'name': 'TATACHEM19DEC480PE', 'Strike': 480, 'LTP': 0.0}, 
      22657794: {'name': 'TATACHEM19DEC490CE', 'Strike': 490, 'LTP': 0.0}, 
      22658050: {'name': 'TATACHEM19DEC490PE', 'Strike': 490, 'LTP': 0.0}, 
      22658306: {'name': 'TATACHEM19DEC500CE', 'Strike': 500, 'LTP': 0.0}, 
      22658562: {'name': 'TATACHEM19DEC500PE', 'Strike': 500, 'LTP': 0.0}, 
      22658818: {'name': 'TATACHEM19DEC510CE', 'Strike': 510, 'LTP': 0.0}, 
      22659074: {'name': 'TATACHEM19DEC510PE', 'Strike': 510, 'LTP': 0.0}, 
      22659330: {'name': 'TATACHEM19DEC520CE', 'Strike': 520, 'LTP': 0.0}, 
      22659586: {'name': 'TATACHEM19DEC520PE', 'Strike': 520, 'LTP': 0.0}, 
      22659842: {'name': 'TATACHEM19DEC530CE', 'Strike': 530, 'LTP': 0.0}, 
      22660098: {'name': 'TATACHEM19DEC530PE', 'Strike': 530, 'LTP': 0.0}, 
      22660354: {'name': 'TATACHEM19DEC540CE', 'Strike': 540, 'LTP': 0.0}, 
      22660610: {'name': 'TATACHEM19DEC540PE', 'Strike': 540, 'LTP': 0.0}, 
      22660866: {'name': 'TATACHEM19DEC550CE', 'Strike': 550, 'LTP': 0.0}, 
      22680578: {'name': 'TATACHEM19DEC550PE', 'Strike': 550, 'LTP': 0.0}, 
      22680834: {'name': 0.0}, 
      18314498: {'name': 'DLF19DEC135PE', 'Strike': 135, 'LTP': 4.0}, 
      18314754: {'name': 'DLF19DEC135CE', 'Strike': 135, 'LTP': 5}, 
      18315010: {'name': 'DLF19DEC140PE', 'Strike': 140, 'LTP': 1.2}, 
      18315266: {'name': 'DLF19DEC140CE', 'Strike': 140, 'LTP': 2.0}} 
  </code></pre>
  
  <p>Let me explain what each term in dictionary means for one line item <code>18315266: {'name': 'DLF19DEC140CE', 'Strike': 140, 'LTP': 2.0}}</code></p>
  
  <p><code>18315266</code> - Token number name - DLF (stock name and CE (Call option)) STrike - 140 ( I want to add LTP of both 140 ce and 140 pe)
  LTP - Last traded price</p>
  
  <p>Here I have a dictionary of multiples stocks, where I have token number as the main key. Inside it we have "name", "Strike" and "LTP" Stocks are filtered by "name" I want to add the LTP of all SAME STRIKE(ex- 135ce and 135 pe) of SAME STOCK (ex-DLF) and then find the minimum combined LTP. For ex- DLFminimumprice( variable) shall be minimum of (combined ltp of 135 Strikeprice and 140 strike price) min ( 9 or 3.2). So it should give me 3.2.</p>
  
  <p>So in a nutshell, I want to add ltp in pairs (where the strike is the same, one for call and second for put), then compare which ltp pair is the minimum of them). I want this minimum value I want this for each and every stock given in the dictionary and I will have more than 200 stocks to do this activity.</p>