Write code to ask the user for a list of coefficients L and a number x. The code computes
L[0] + L[1]*x + L[2]*x**2 + .. + L[n]*x**n,
where n = len(L) - 1.

You may not make assumptions on the length of the list, the script must work for all lists of all lengths.

  1. For a list of 4 elements and some letter x, make a table with values for all variables in the loop,
    The table must have as many rows as there are stages in the loop.

    Answer:

           L     | i | R
      -----------+---+-----------
       [1,2,3,4] | - | L[0]
       [1,2,3,4] | 1 | L[0] + L[1]*x 
       [1,2,3,4] | 2 | L[0] + L[1]*x + L[2]*x**2
       [1,2,3,4] | 3 | L[0] + L[1]*x + L[2]*x**2 + L[3]*x**3
    

  2. Write Python code for the script below:

    Answer:

    L = input('Give a list : ')
    x = input('Give a number : ')
    R = L[0]
    for i in range(1,len(L)):
       R = R + L[i]*x**i
    print 'the result :', R