Python 3: Traceback : TypeError
<p>I'm new in python 3 and I don't understand why I get a Type Error (this is a guess a number game for numbers between 0-100):</p>

<pre><code>print("Please think of a number between 0 and 100!")
low = 0 
high = 100
check = False
while True :
    guess = (low + high)/2
    print("Enter 'h' to indicate the guess is too high.\n")
    print("Enter 'l' to indicate the guess is too low.\n" )
    print("Enter 'c' to indicate I guessed correctly.\n")
    ans = input("")  
    if ans == "h" :
        low = ans
    elif ans == "l" :
       high = ans
    elif ans =="c" :
        print( "Game over. Your secret number was:{}".format(guess))
        break
    else :
        print("Sorry, I did not understand your input.")
</code></pre>

<p>here is the error : </p>

<pre><code>Traceback (most recent call last):
 File "&lt;stdin&gt;", line 1, in &lt;module&gt;
</code></pre>

<p>Thanks in advance.I'd really appreciate your help I'm stuck in this</p>

<p>On the line <code>low = ans</code> you set low to be a string value, the string value "h"</p>

<p>Then on the second time you pass through the loop, you try to calculate
<code>(low + high</code>)/2`  You can't calculate  ("h" + 100)/2 because you cant add the string to the integer. This is a "type error"</p>

<p>For each line explain to a friend (or a soft toy) what each line does and why you are certain each line is correct.</p>

python typeerror traceback