Registry Synced

Jan 2026 - Python - Week 9 - PPA 12

352 words
2 min read

PPA 12

Course: Jan 2026 - Python
PPA 12
Due Dec 31, 2026 at 11:59 PM IST
Instructions
Use "Test Run" to verify your code with public test cases.
Press "Submit" to have your assignment evaluated.
You can submit your assignment multiple times up until the deadline.
Make sure to submit your final code by the deadline to receive your score.
Summary
- out of100
Score
Public Tests
0/0 Passed
Private Tests
0/0 Passed

A polynomial is a mathematical function of the following form:
f(x)=a0x0+a1x1+a2x2++anxnf(x) = a_0 x^0 + a_1 x^1 + a_2 x^2 + \cdots + a_n x^{n}
The aia_is are called the coefficients of the polynomial and uniquely determine it. This polynomial can be represented in Python using a list of its coefficients:
L = [a_0, a_1, a_2, . . ., a_n]
Note that L[i] corresponds to the coefficient aia_i of xix^i in f(x)f(x), for 0in0 \leq i \leq n.

Write a recursive function named poly that accepts the list of coefficients L and a real number x_0 as arguments. It should return the polynomial evaluated at the value x_0. For example poly([1, 2, 3], 5) should return the value 1+2×5+3×52=861 + 2 \times 5 + 3 \times 5^2 = 86.

You do not have to accept input from the user or print the output to the console. You just have to write the function definition.

Public Tests ( 0/0 )

Case 1

Input:
text
[1, 2, 3]
5
Expected Output:
text
86

Case 2

Input:
text
[1, -2, 3, 4]
10
Expected Output:
text
4281

🔒 Private Tests ( 0/0 )

This test case group is locked and will be revealed after the deadline.


💻 IITM Official Solution

Solution code is currently locked and will be available after the deadline.

💻 My Submitted Code

python
def poly(L, x_0):
    """
    A recursive function to compute the value of a polynomial.

    Parameters:
        L: list of integers
        x_0: integer
    Return:
        result: integer
    """

Document Outline
Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.