Confused by results from simple calculation
<p>I am not sure why the below code is not working. I am running this in python 3.5.2 and the problem appears to be in the calculation portion of the code. It returns no errors but gives huge values that shouldn't be the average of the 5 inputs.</p>

<pre><code>#inputs
year1 = input("Enter wins for year 1: ")
year2 = input("Enter wins for year 2: ")
year3 = input("Enter wins for year 3: ")
year4 = input("Enter wins for year 4: ")
year5 = input("Enter wins for year 5: ")

#calculation
averageWin = int(year1 + year2 + year3 + year4 + year5) / 5
#output
print ("Average wins are", averageWin)
</code></pre>

<p>you need to cast the input values to integer individually</p>

<pre><code>averageWin = (int(year1) + int(year2) + int(year3) + int(year4) + int(year5)) / 5
</code></pre>

<p>What you did before was concatenating the strings:</p>

<pre><code>int('100' + '100') =&gt; int('100100') =&gt; 100100
</code></pre>

python python-3.x average