A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

hey, so i'm at the python Shell i did "import math" and now i'm trying to do the exercise but it says "Traceback (most recent call last): File "<pyshell#9>", line 1, in <module> 34*x^2+68*x-510 NameError: name 'x' is not defined" what am i doing wrong? Thanks, take care.

  • This Question is Open
  1. amistre64
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    i would say you are not properly defining "x"

  2. amistre64
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    can you post your code?

  3. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i just wrote 34*x^2+68*x-510 directly i did the import math before and after that i just did 34*x^2+68*x-510 how can i define x? i'm really new at this

  4. anonymous
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    oh i did it, it was so simple, thanks anwyay for your time :)

  5. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Python doesn't use the carat ( "^" ) character for exponents. Python uses "**" so your answer isn't correct. >>> x = 2 >>> x ^ 4 6 >>> x ** 4 16

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

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.