why do I get unsupported operand type(s) type error?
<p>ok, so I got a little exercise for python and I want to find the values of speed and location at every second from 0 to 30th within a list. also it must notify me when they intersect. while finding the location of the first car I am to use the method of Trapezoid code only.</p>

<p>the speed equation of the first car is V1=t^3-3*t^2+2*t and the second is V2=10*t</p>

<p>my code:</p>

<pre><code>def cars():

    def LocationV1(x):
        x=x*1.0
        h=x/1000.0
        m=0
        n=m+h
        L=0.0
        for i in range (0,1000):
            def f(u):
                return u**3+3*u**2+2*u
            L=L+(f(m)+f(n))*h/2
            m=m+h
            n=n+h
        return L
    def LocationV2(x):
        x=x*1.0
        def g(x):
            return 5*x**2/2
    def SpeedV1 (x):
        x=x*1.0
        return x**3-3*x**2+2*x
    def SpeedV2 (x):
        x=x*1.0
        return 10*x
    V1=[]
    V2=[]
    t=0
    a=LocationV1(t)
    b=LocationV2(t)
    while t&lt;=30:
        t=t+1
        V1=V1+[[LocationV1(t), SpeedV1(t), t]]
        V2=V2+[[LocationV2(t), SpeedV2(t), t]]
        print V1
        print V2
        if (a-b)&lt;=0.1:
            print "cars meet"
</code></pre>

<p>when I use this code it gives me such an error:</p>

<pre><code>Traceback (most recent call last):
  File "&lt;pyshell#8&gt;", line 1, in &lt;module&gt;
    cars()
  File "C:/Users/ÖZGÜR/Desktop/ödev", line 35, in cars
    if (a-b)&lt;=1:
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
</code></pre>

<p>what do I do now?</p>
