title: TypeError: 'float' object is not subscriptable(line 144)
body: <p>this is my code:</p>
  
  <pre><code>    if opt == "4":
          while True:
              cart_for_remove()
              remove = input("Please key in the corresponding number of the item you want to remove:")
              if remove.isalpha()==True:
                  print('Please enter a valid number!')
                  break
              if count==0:
                  print('Please add item to cart first!')
                  break
              if int(remove)&lt;=count:
                  remove = int(remove) - 1
                  price_remove = float(cart[remove][3].strip('$ '))
                  total_price_final -= price_remove
                  savings_remove = int(total_savings[remove][2].strip('$ '))
                  total_savings-=savings_remove
                  del cart[remove]
                  print("Item has been successfully removed from cart!")
                  break
              else:
                  print('Please choose a valid option')
                  break
  </code></pre>
  
  <p>everything is correct until line 143.On line 144, I tried to remove the savings from total savings if item is being removed, however, this error is showing up:</p>
  
  <blockquote>
  <pre><code>line 144, in &lt;module&gt;
      savings_remove = int(total_savings[remove][2].strip('$ '))
  TypeError: 'float' object is not subscriptable.
  </code></pre>
  </blockquote>
  
  <p>Anyone know how to correct the code,such that this error doesnt show up?</p>
  
  <p>Any help/feedback is greatly appriciated.Thanks!</p>