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

hi! question! for #2 in ps2 so the code is def compute_deriv(poly): poly_deriv=[] for i in range(1, len(poly)): poly_deriv.append(float(i*poly[i])) return poly_deriv why is the range(1, len(poly)) and not (0, len(poly))?

OpenStudy (rsmith6559):

Just for fun, run it with the line: print poly[0] and see what poly[0] is. Sometimes it's convenient to use a list as one based instead of zero based. The real answer will be in the code that builds poly.

OpenStudy (anonymous):

thanks!

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!