Dear friends. It is still going over my head as greyhound. This is no bueno...... Problem set 3, I can't understand and it is due tomorrow....
Where are you stuck? Is there a specific question? The instructions seemed quite clear to me!
chris2332 what's wrong with this code: def evaluatePoly(poly, x): ''' Computes the value of a polynomial function at given value x. Return that value as a float. poly: list of numbers, length > 0 x: numbers returns: float ''' if (len(poly)== 0): return float(0) result = float(poly[0]) index = 1 while index!=len(poly): result += poly[index]*x**index index += 1 return result
What's the error you are getting?
The while block and the last return statement needs indentation!
Join our real-time social learning platform and learn together with your friends!