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><code>split()</code> returns a list which you are trying to convert to an integer.
You probably wanted to convert everything in the list to an integer:</p>

<pre><code>N = [int(i) for i in input().split()]
</code></pre>

<p>You can also use <code>map</code>:</p>

<pre><code>N = list(map(int, input().split()))
</code></pre>

python