title: Python type conversion error
body: <p>Am trying to print a given result using the <code>str.format()</code> in python but I keep running into an TypeError. Here is my current piece of code that gives me the error:</p>
  
  <pre><code>def Restaurant_calorie_average(rest):
      result = []
      for item in rest.menu:
          result.append(item.calories)
      return sum(result)/len(rest.menu)
  
  def Restaurant_str(self: Restaurant) -&gt; str:
  return (
      "Name:     " + self.name + "\n" +
      "Cuisine:  " + self.cuisine + "\n" +
      "Phone:    " + self.phone + "\n" +
      "Menu:     " + Menu_str(self.menu) +  "\n"+
      "\t  Average Price: {0:3.2f}.  Average calories {1:}: ".format(Restaurant_price_average(self), str(Restaurant_calorie_average(self))) + "\n\n")
  
  def Collection_str(C: list) -&gt; str:
  ''' Return a string representing the collection
  '''
  s = ""
  if not C:
      return ''
  else:
      for r in C:
          s = s + Restaurant_str(r)
      return s
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <pre><code>    Traceback (most recent call last):
    File "C:\Users\Sage\workspace\hello\restaurantsg.py", line 229, in &lt;module&gt;
      restaurants()
    File "C:\Users\Sage\workspace\hello\restaurantsg.py", line 19, in restaurants
      our_rests = handle_commands(our_rests)
    File "C:\Users\Sage\workspace\hello\restaurantsg.py", line 48, in handle_commands
      print(Collection_str(C))
    File "C:\Users\Sage\workspace\hello\restaurantsg.py", line 176, in Collection_str
      s = s + Restaurant_str(r)
    File "C:\Users\Sage\workspace\hello\restaurantsg.py", line 84, in Restaurant_str
      "\tAverage Price: {0:3.2f}.  Average calories: {1:}".format(Restaurant_price_average(self), Restaurant_calorie_average(self)) + "\n\n")
    File "C:\Users\Sage\workspace\hello\restaurantsg.py", line 113, in Restaurant_calorie_average
      return float(sum(result)/len(rest.menu))
  TypeError: unsupported operand type(s) for +: 'int' and 'str'
  </code></pre>
  
  <p>What I don't understand is, that another function <code>Restaurant_price_average()</code> in my program has the exact same parameters and returns a float like the <code>Restaurant_calorie_average()</code> and it works just fine in the current program if I remove the <code>Restaurant_calorie_average()</code> part. I tried type converting 'Restaurant_calorie_average()<code>into string, putting float in format {1:3.1f}</code>  but it still doesn't seem to work. Can anyone help me with this? The full program is here <a href="https://drive.google.com/file/d/0B12K4C_ZJog4eE91T0FxRDBaUFk/view?usp=sharing" rel="nofollow">Rprogram</a>  for your reference. </p>