title: Finding fault in this recursive list addition in python
body: <p>I need to create a program that takes in an array of numbers, check if each number is greater than the sum of all previous numbers, and output true if the condition is met, and false, if not. My trial is presented below:</p>
  
  <pre><code>import fileinput
  a0 = [int(i) for i in fileinput.input()]
  a = a0[1:]
  b=[]
  for i in range(1, a0[0]+1):
    b.append(a[i])
    if (a[i+1] &gt; sum(b)):
      print("true")
      break
    else:
      print ("false")
      break
  </code></pre>
  
  <p>My program works for half of the test cases but fails for the other test. Could you please help me figure out what i am doing wrongly. Many thanks for your assistance.</p>