Python Code Error
<p>What's wrong with this program in Python? </p>

<p>I need to take an integer input(N) - accordingly, I need to create an array of (N)integers, taking integers also as input. Finally, I need to print the sum of all the integers in the array.</p>

<p>The input is in this format: </p>

<pre><code>5

4 6 8 18 96
</code></pre>

<p>This is the code I wrote : </p>

<pre><code>N = int(input().split())
i=0
s = 0
V=[]
if N&lt;=100 :
    for i in range (0,N):
        x = int(input().split())
        V.append(x)
        i+=1
        s+=x
print (s)
</code></pre>

<p>Its showing the following error.</p>

<pre><code>Traceback (most recent call last): 
  File "main.py", line 1, in &lt;module&gt;
N = int(input().split())
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
</code></pre>

<p>You code fails because str.split() returns a list.
<a href="https://docs.python.org/2/library/stdtypes.html#str.split" rel="nofollow">From the Python documentation</a></p>

<blockquote>
  <p>Return a list of the words in the string, using sep as the delimiter
  string</p>
</blockquote>

<p>If your input is a series of numbers as strings:</p>

<pre><code>1 2 3 4
</code></pre>

<p>You'll want to iterate over the list returned by input.split() to do something with each integer.</p>

<pre><code>in = input()
for num in in.split():
    x.append(int(num))
</code></pre>

<p>The result of this will be:
    x = [1,2,3,4]</p>

python