Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

southpaw118 Group Title

I'm using Linux Mint 14 (Nadia) and Python 2.7.3. I can't get that 'Cube Root of a Perfect Cube" program working. It prompts me to enter an integer and when I do and hit enter, I go right back to the prompt. Anyone else with this problem?

  • one year ago
  • one year ago

  • This Question is Closed
  1. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Did you try tossing in some print statments?

    • one year ago
  2. harsimran_hs4 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    yes e.mccormick is right , to print something on screen you need to insert print statements in your code Going back to the prompt without error means that program executed properly(even tough in this case did not gave the desired result i.e to print the answer)

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

    Thanks a lot. Let me give that a try.

    • one year ago
  4. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Many programmers will make some sort of console dump or printout to debug things. There are tons of debugging tools, but the basic "print this variable at this instant" method has a serious advantage: It is very easy to do and does not rely on you managing to get the program to stop at just the right moment. I have had a loop print "in loop" at the top just to make sure it was actually looping... found out it was going in, but not looping, traced down the logic error, ran again and got tons of "in loop" messages so I knew that was fixed. Little things like that can be invaluable! So even if you don't print a variable, printing a message would let you know that Python was working.

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

    and also, as Prof Guttag points out in his lecture on debugging, don't just output value for debugging purposes. When you're able (which you should always be) add more to the output to provide context. specifically what variable you're outputting and what you expect it to be. That will make discrepancies jump out at you even more and can save you from your own subliminal assumptions which can take hours to track down in complicated algorithms

    • 4 months ago
  6. seandisanti Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    and apparently this is an old thread, sorry for the accidental bump

    • 4 months ago
  7. seandisanti Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    and that one

    • 4 months ago
  8. seandisanti Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    bah, i give up. back to work

    • 4 months ago
  9. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Might as well close it. It is 7 months old. Hehe

    • 4 months ago
    • Attachments:

See more questions >>>

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.