title: Python- Average Rainfall
body: <p>I have this code for average rainfall that I have been trying to figure out with the user entering the rainfall per month. But I keep getting this error code:</p>
  
  <pre><code>  File "/Users/brittneybutcher/Desktop/UM-Flint/Average Rainfall.py", line 17, in &lt;module&gt;
      "Average rainfall: " + format( averagerainfall, ".2f" ) )
  TypeError: bad operand type for unary +: 'str' "
  </code></pre>
  
  <p>Can anyone tell me what is wrong with it?</p>
  
  <pre><code>for currentyear in range( 1, usernumberofyears + 1):
      for currentmonth in range( 1, 13):
          monthlyrainfallinches = float( input( "Please type the inches of rainfall for month " + \
                                                format( currentmonth, "d" ) + ", year " + format( currentyear, "d" ) + \
                                                ": " ) )
          totalinchesofrainfall += monthlyrainfallinches
          totalnumberofmonths += 1
  
  averagerainfall = totalinchesofrainfall / totalnumberofmonths
  
  print( "Number of Months: " + format( totalnumberofmonths, "d"), "Total inches of rainfall: " \
         + format( totalinchesofrainfall, ".2f" ), + \
         "Average rainfall: " + format( averagerainfall, ".2f" ) )
  </code></pre>