Python - Why are some test cases failing?
<p>So I'm working through problems on hackerrank, I am a beginner in python.</p>

<p>The information about what I'm trying to dois found here: <a href="https://www.hackerrank.com/challenges/compare-the-triplets?h_r=next-challenge&amp;h_v=zen" rel="nofollow">https://www.hackerrank.com/challenges/compare-the-triplets?h_r=next-challenge&amp;h_v=zen</a></p>

<pre><code>a0,a1,a2 = input().strip().split(' ')
a0,a1,a2 = [int(a0),int(a1),int(a2)]
b0,b1,b2 = input().strip().split(' ')
b0,b1,b2 = [int(b0),int(b1),int(b2)]

a1 = 0
b1 = 0
lst1 = a0,a1,a2
lst2 = b0,b1,b2

for x, y in zip(lst1, lst2):
    if x &gt; y:
        a1 += 1

    if x &lt;y:
        b1 += 1

    else:
        pass

print(a1, b1)
</code></pre>

<p>So this works perfectly well.</p>

<p>However, in one of the test cases, the input is </p>

<pre><code>6 8 12
7 9 15
</code></pre>

<p>and output should be </p>

<pre><code>0 3
</code></pre>

<p><strong>However my code keeps failing it. Why is this so?</strong></p>

<p>I find 2 issues in this. 
1. variable names are same. Notice a1 in list and and a1 as a separate Variable.
2. Instead of print you can use '{0} {1}'.format(a1,b1)
Also I would suggest using raw_input() instead of input(), that will help your input treated as a string.</p>

python