How to obtain the nth row of the pascal triangle
<p>Here is my code to find the nth row of pascals triangle</p>

<pre><code>def pascaline(n):
     line = [1]       
     for k in range(max(n,0)):             
         line.append(line[k]*(n-k)/(k+1))             
     return line
</code></pre>

<p>There are two things I would like to ask. First, the outputs integers end with .0 always like in </p>

<pre><code>pascaline(2) = [1, 2.0, 1.0]
</code></pre>

<p>How do I remove those .0 at the end? also, how can I do to start at $n=1$ and not at $0$? For instance, in this case, pascaline(2) should be [1, 1] and not [1, 2, 1]</p>

<p>subtract 1 from n and typecast. basically change your method to this:</p>

<pre><code>def pascaline(n):
    n = n - 1
    line = [1]

    for k in range(max(n ,0)):

        line.append(int(line[k]*(n-k)/(k+1)))

    return line
print(pascaline(5));
</code></pre>

python