zerodivisionerror-Float division error
<pre><code>ctr=0.0
i=0
pc=0.0
pi=0.0
nc=0.0
ni=0.0


for line in fileinput.input(['/pro/file1']):
    line = line.replace("\n", "")
    if (i &lt; len(revs)): 
        if('pos' in revs[i]):
            if(float(line) &gt; 0):
                ctr=ctr+1
                pc=pc+1

            else:
                                pi=pi+1

        elif('neg' in revs[i]):
            if(float(line) &lt; 0):
                ctr=ctr+1
                nc=nc+1

            else:
                                ni=ni+1

    i=i+1
precision = pc/(pc+pi)
recall = pc/(ni+pc) 
</code></pre>

<p>This code is about sentiment analysis.I am getting <strong>ZeroDivisionError:Float division by zero</strong> when I try to find accuracy and recall.how to fix it??</p>
