My code produces ouput which seems to be incorrect on all elements except the last one. Been trying to debug for hours but couldn’t figure it out. Appreciate if someone can shred some light here. Thx.
Screenshots:
My code produces ouput which seems to be incorrect on all elements except the last one. Been trying to debug for hours but couldn’t figure it out. Appreciate if someone can shred some light here. Thx.
Screenshots:
Finally debugged it. It was due to a trivial oversight but caused serious, hidden error: The use of “break” instead of “continue” to stay in the inner loop.
Okay… I was just about to pull up this lab for you to have a look, but sounds like you got it.
I would only say, don’t feel frustrated-- I found the labs in the last two courses a bit more challenging too…
*And now that I look at it since its up, yes, this stumped me at first too-- I had to look up the relevant Python term to jump to the next iteration without cutting the loop.
Also @Alex_Tu, just a suggestion as you’ve been asking a lot of questions lately, and then, in the end, been able to figure them out yourself…
So, I mean, have a little confidence (and patience) in yourself.
There is nothing wrong with asking questions-- At times, even I have gotten to the point where I have been like ‘okay, I have no idea what is going on here, I give up’ and have asked.
But make sure to give yourself a chance first-- That is all part of learning.
@Nevermnd I usually post questions only after having spent hours debugging but not able to resolve it while facing a deadine. Especially after scrolling thru this community site for similar answer for hours without success on top of the site being not so easy to navigate.
But sometimes after posting the issue, I would find some answer to another unrelated question but it raised some intuition to the answer for my question.
Hence, posting to get some help on clues, hints, insights. Having done so only twice - not a lot!
I have been there in such situation, totally get it. I know you are a learner who tries alot harder yourself on finding solutions even after posting query and that’s a sign of good learner. So just keep learning and ask question or doubt without any hesitation, even you finding your solution for your own post can give other learners to find similar issue solutions.
Regards
DP
@Alex_Tu yeah, no, it is fine-- My point was just you’ve been able to figure it out on you own, in the end-- So give yourself some credit
For myself, I also find (even though it can be very frustrating), it is much more satisfying when, for something I’m stumped on, I finally figure it out on my own, rather than just ‘get the answer’.
Finally ‘deadlines’, for a class, are sometimes not strictly good to impose on oneself in this sort of environment IMHO-- everything does take time to ‘sink in’.
So, as DP says, still ask questions, there is no problem with that. Just ensure to have confidence in yourself and give it your best effort.
Best of luck
-A