anonymous
  • anonymous
Hi, I am working on MIT 6.189 in hw_2 Ex 2.3 my math functions work in the command line when I use math.sin(math.pi) for example, but when I put the sin and cos values in the multadd function python seems to not recognize the math.sin and math.cos. i tried calling the math library inside the multadd function but it did not work. Does anyone know how to fix this?
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

e.mccormick
  • e.mccormick
Is it tossing any errors?
anonymous
  • anonymous
Hi, yes this is the error Traceback (most recent call last): File "C:\Users\Sotero\Desktop\Python HW\hw2.py", line 76, in b=math.cos(math.pi/4) NameError: name 'math' is not defined
e.mccormick
  • e.mccormick
What import statment(s) did you use? ``` from math import * ``` Is not that great. You might try: ``` import math ``` They did that poorly in the MIT class.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
I did import math .Apparently, I have to be in the command line to write the formula. It does not work in the shell.It is working now. Thanks for your help :)
e.mccormick
  • e.mccormick
Strange. I wonder if it has some pathing issue.

Looking for something else?

Not the answer you are looking for? Search for more explanations.