On Problem Set 2 Question 1, I can't get the inter active mode to print out the function. If I input something like:
>>> poly = (0.0, 0.0, 5.0, 9.3, 7.0)
>>> x = -13
>>> print evaluate_poly(poly, x)
180339.9
But instead it says something like
Traceback (most recent call last):
File "
Assuming that you posted the entire session, either evaluate_poly() will need to be typed in before those three lines, or it will need to imported from a file: from whateverFile import evaluate_poly
Ok, well that is good to know. Python is still a little weird to me with this whole interactive mode. I wasn't importing or typing in the code for the evaluate_ploy(). Once I did that it worked like a charm! Thanks!
During testing/debugging, trying something new, the interactive is great. It's actually a shell environment, separate from writing a file and then executing it.
Join our real-time social learning platform and learn together with your friends!