title: Dictionary value "not defined" Python
body: <p>I'm working on a simple grocery list for class. In the first step we create an empty dictionary and list to be filled by input from a user. All grocery items go into a dictionary (grocery_item{}) and all of the dictionaries are to be added to the list (grocery_history).</p>
  
  <p>My script currently looks like this:</p>
  
  <pre><code>grocery_item = {}
  
  grocery_history =  []
  
  stop = 'go'
  
  while stop == 'go' or stop == 'c':
      item_name = input("Item name: \n" )
      quantitiy = int(input("Quantitiy purchased:\n" ))
      cost = float(input("Price per item:\n" ))
      grocery_item.update({'name' : item_name, 'number' : quantitiy, 'price' : 
                          cost})
      grocery_history.append(grocery_item)
      stop = input("Would you like to enter another item?\n Type 'c' for continue 
                   or 'q' to quite:\n")
  </code></pre>
  
  <p>If I print grocery_history at this point, it will print the list of dictionaries  exactly as I intended. In the next step of the grocery list, we are trying to find the grand total of the items. However, whenever I try to find each items individual value, using for loops to get to each dictionary in the list, I receive an error claiming that keys are not defined, even though it just printed the dictionary entry for that grocery item, and all of the keys had values. </p>
  
  <p>My script for this section looks like this:</p>
  
  <pre><code>grand_total = 0
  
  for item in grocery_history:
      I = 0
      for price in item:
          item_total = number * price
          grand_total += item_total
          print(number + name + '@' + '$' + price + 'ea' + '$' + round(item_total,2))
          item_total = 0
          I += 1
  
  print('$' + round(grand_total,2))
  </code></pre>
  
  <p>The error is for the line in which I am trying to find the item_total, because it is the first line I try to use one of the keys. I have tried to rewrite the keys as grocery_item(numbers)/grocery_item(price), and receive the same error message. </p>
  
  <p>I appreciate any help, and thanks in advance!</p>