title: Python: Type Error unsupported operand type(s) for +: 'int' and 'str'
body: <p>I'm really stuck, I am currently reading Python - How to automate the boring stuff and I am doing one of the practice projects.</p>
  
  <p>Why is it flagging an error? I know it's to do with the item_total.</p>
  
  <pre><code>import sys
  
  stuff = {'Arrows':'12',
       'Gold Coins':'42',
       'Rope':'1',
       'Torches':'6',
       'Dagger':'1', }
  
  def displayInventory(inventory):
      print("Inventory:")
      item_total = sum(stuff.values())
      for k, v in inventory.items():
          print(v + '   ' + k)
      a = sum(stuff.values())
      print("Total number of items: " + item_total)
  
  displayInventory(stuff)
  </code></pre>
  
  <p>error i get:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "C:/Users/Lewis/Dropbox/Python/Function displayInventory p120 v2.py", line 17, in 
        displayInventory(stuff)
      File "C:/Users/Lewis/Dropbox/Python/Function displayInventory p120 v2.py", line 11, in displayInventory
        item_total = int(sum(stuff.values()))
    TypeError: unsupported operand type(s) for +: 'int' and 'str'</p>
  </blockquote>