Neural Sync Active
Jan 2026 - Python - Week 9 - PPA 12
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+⋯+anxn
The ais 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 ai of xi in f(x), for 0≤i≤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=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:
text86
Case 2
Input:
text[1, -2, 3, 4] 10
Expected Output:
text4281
🔒 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
pythondef 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 """