TypeError: can only concatenate tuple (not "list") to tuple"
<p>I wrote a simple script to simulate customer lifetime value (LTV) based on average revenue per user (ARPU), margin and the number of years customers remain customers (ltvYears).  Below is my script.  It throws an error at this line "ltvYears = ltvYears + [ltv_loop]".  The error message is "TypeError: can only concatenate tuple (not "list") to tuple".  Can someone tell me what is causing this? I suspect the problem may stem from "ltvYears = ('f',[])" where I added the type code to eliminate another error (multiplying float by int).</p>

<p>I'm new to Python so there's very likely a beginner mistake in this code.</p>

<pre><code>lowYears = 0
highYears = 20
modeYears = 3
ARPU = 65.0*12.0
MARGIN = .30
ltvYears = ('f',[])
ltv = []

def ltv(arpu, years, margin):
    return arpu * years * margin

N = 10000    
for n in range(N):
    #estimate LTV
    ltv_loop = random.triangular(lowYears, highYears, modeYears) 
    ltvYears = ltvYears + [ltv_loop]
    ltv = ltv + [ltv(ARPU, ltvYears, MARGIN)]

show = 0

if (show==1):
    #plot ltv histogram
    plt.hist(ltv,bins=10)
    plt.title("LTV Probability Density")
    plt.xlabel("")
    plt.ylabel("$")
    plt.show()
</code></pre>

<p>EDIT - Here is a screenshot of my variables.
<img src="http://i.stack.imgur.com/UgPF9.png" alt="enter image description here"></p>

<p>EDIT2 ---I figured out the solution thanks to the help below.  There were three problems in total:</p>

<ol>
<li>I mistakenly assigned the same name to a variable and function (+1 @autopopulated for pointing that out)</li>
<li>This line was extraneous "ltvYears = ltvYears + [ltv_loop]"</li>
<li>This line should have used used "ltv_loop" for the second argument "ltv = ltv + [calculateltv(ARPU, ltv_loop, MARGIN)]"</li>
</ol>

<p>+1 @DonCallisto and @RikPoggi for the help that on items 2 and 3</p>
