|
UPDATE Please see additional comment below original question. Hello, I am having a bit of trouble coming up with the correct answer on number 6. Code in general is completely new to me and these courses, where as they are done well, the pace is very quick. I spent over ten hours straight on Unit 2 and homework the other day, and I'm finally coming back to it to try again. I've finally gotten further in the homework, and I know I can get this if I just keep at it. On problem 6 of the homework, I feel like I have a valid code that should work. It's going to be a bit difficult to talk about since, I can't post code or any potential answers (though obviously my 'answer' is wrong since it isn't working). Basically I combined knowledge from Unit 2.15 and 2.25. That's the best way I can explain it without posting my code. However, when I try to print find_last('aaaa','a'), I don't get any result. I don't even get an error message. I simply get an orange pop-up box at the top that says "Try again!" What does this mean? Without any kind of code error and/or output, I don't really have anything to go off of where to correct my code. Any assistance would be greatly appreciated. I really want to get this done before tomorrow night. Thank you, Shay |
The question has been closed for the following reason "bdiddy was able to assist in the flaw of my formula on another thread. Thanks everyone! :)" by Shay 06 Mar '12, 08:14
|
No result, no feedback.. it sounds like you may have your indents off. Is your print statement within the function? (it shouldn't be, but it can be if your indents are off, etc). Also, it's possible that you have an infinite loop. Make sure you terminate your code for all possible inputs. Do you only use the udacity interpreter, or do you have a local one? I double-checked my indents. What I have without posting the actual code is the following: Sorry, I seem to have missed the last part of that. The answer to the second question is I use the udacity interpreter. I couldn't remember where I saw it in unit 1 with the information on where to download. I ended up downloading 3.2, but not sure if that's the correct one. Thanks to this website http://people.csail.mit.edu/pgbovine/python/tutor.html that someone posted just recently, I was able to determine it's due to an infinite loop. So now I just have to figure out why it's an infinite loop and hopefully find a way to correct it. |
|
Try again , wont be popped up in Homeworks .. For no output , try doing a dry run ... check variable by variable ...you should get the issue with dry run!! |
UPDATE I kind of had this going in another thread, but I didn't want to deter that thread from its original post about this website. http://people.csail.mit.edu/pgbovine/python/tutor.html
Ok, so with this site, I was able to find out that I have an infinite loop. However, based on the information it's showing me in each step, I don't understand why my code is not working. Without posting any exact code since it's homework...
I have the following.
Based on the information provided in the website, my variable1 is changing correctly as I intended it. The formula for variable2 contains variable1, however the value for variable2 does not seem to be changing. If variable1 is changing each time it goes through the loop, shouldn't variable2 automatically be modified as well?
Any advice or explanation?