Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 11 Online
OpenStudy (anonymous):

Friends 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

OpenStudy (anonymous):

The indentation of the while block and the final "return" statement!

OpenStudy (anonymous):

please use a code pasting site: - http://dpaste.com - http://pastebin.com - http://www.repl.it/ - http://pastie.org - http://codepad.org - http://ideone.com paste your code there and post the link here. select Python syntax highlighting when u paste.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!