title: How to grab the value of a key in dict and check user controlled dictionary for existing values?
body: <p>I have two dictionaries, one that contains a menu of items with their prices and an empty one that serves as the shopping cart.</p>
  <p>The shopping cart allows players to store their item(s) there &amp; how many they want of it, before they are ready to checkout. If a player wishes to add more of the same type, I want the program to be able to check if it already exists there or not and be able to add existing and new values together.</p>
  <p>Finally, when the user is ready to check out, I want to be able to grab the value of the first dictionary and multiply that by the amount of items the user gave.</p>
  <p>Below is an example of how I have the code planned in my mind, obviously it's not proper code but it should give an idea of what I want to achieve here.</p>
  <p>Menu dictionary shows item name + price and shopping_cart shows item name + amount</p>
  <pre><code>menu = {'litago': 25,
          'sandwich': 40,
          'cola': 30,
          'fruit': 15,
          }
  
  shopping_cart = {'cola', 1}
  
  def AddItem():
      item_input = input(&quot;What would you like to add?&quot;.lower() # Cola
      item_amount = int(input(&quot;How many would you like to add?&quot;) # 1
      if item_input in shopping_cart:
          existing_amount = grab value of cola in shopping cart here
          item_amount = item_amount + existing_amount
      else:
          shopping_cart[item_input] = item_amount
  
  def Checkout():
      for every unique item in the shopping cart:
          multiply amount per unique item with corresponding price in the menu
  </code></pre>
  <p>I've already put in checks to make sure that the user input corresponds to an item that already exists on the menu, it will give off an error if the item does not exist.</p>