How do I need to think about solving challenges?

Hello Everyone,

Its been three months of learning Python, spending hours at a time on the Codecademy’s site and I seem to be still lost as to how to best answer these coding challenges without having to click the solution button.

Moreover, is it my imagination or does it seem as though each challenge question may have parts of things that were previously taught, but the series of steps to solve each new problem vary to the point where every new method requires a different set of steps to solve. And I still don’t feel confident to answer any Python related questions in a forum setting.

It feels like I’m supposed to connect the dots but the dots aren’t on the page. It’s a little discouraging because I’m starting to feel incompetent. I know what for loops are, what is a while loop, and I understand most of the syntax when it is explained in the hints section or after I see it in the solution, but perhaps I’m missing some sort of creative element in figuring out how to solve these challenge questions.

I would like to know how others are able to solve these challenge questions or is everyone else racking their brain and revisiting past assignments in the hopes that something will jump out and make sense.

As a side note: Can anyone tell me if once we complete the codecademy course, are we in a position to begin seeking employment, or is this only a hobby level of skills.

Any response welcomed and thanks.

10 Likes

Can you solve the problems manually?
If so, you’ve already got the steps figured out.

1 Like

If “solve the problems manually” means knowing what to write in the answers, I follow whatever instructions that are left in the ‘Get a hint’ sections of the course. I have been able to solve the most simplest of problems but ones like this one in discussion, I NEVER would have deduced what to do on my own.

This is an example of a problem that I did not know how to approach, until I clicked the Solution button.

def larger_sum(lst1, lst2):
sum1 = 0
sum2 = 0
for number in lst1:
sum1 += number
for number in lst2:
sum2 += number
if sum1 >= sum2:
return lst1
else:
return lst2

To me, the situation is like this: We all know how to operate a drill, an electrical saw, a hammer, screwdriver, and a wrench. Now, does that mean we have the knowledge to build a house, or a car, even with all of the materials included? After the foundation (in the case of programming, the def statement, followed by the parentheses and arguments) What comes next and when?

So I have all of the tools but none of the skills/experience as to when to apply which tool or when to use several tools in combination. As I asked earlier, how is everyone else able to solve the challenge problems if they have had no prior knowledge of programming?

Again, any response welcomed. Thanks.

3 Likes

It means, given pen and paper, and the input, could you produce the looked-for output?
Or in your head for that matter.

You carry out a bunch of steps to do that.

A programming language provides ways for you to shuffle information around, same as what you did yourself.
So, what were the steps? Maybe you’d start by writing them down. You may need to break them down into smaller parts, ones that you know how to do in python.

I think you’ll find that if you put words to how the problems can be solved, that’ll be quite close to what you’d write in python.
There’s no human reading those words, you have to spell everything out in full detail.

If there’s some part of what you wrote that you don’t know how to express then you’re already a good way to finding it out, because at that point you’ve identified what information you need. It can probably be googled!

Arguably we all have a life-long experience of this information-wrangling.

5 Likes

Hello @refined_silver,

I wanted to mention that I feel in a similar way as you do, however I am not giving up. I have been making a lot of notes from previous lessons, so it is easier to review previous concepts when I am stuck since I have my notes organized (note that every person learns differently - for someone note taking is useful, someone organizes their thoughts on spreadsheet, someone does not need all that because they have great “mental storage” capabilities - so you need to find what is your best way).

Main thing I think is not to look at the answers and hints right away until you absolutely exhausted all of your knowledge and ideas. Try tweaking your code, understand what program will be doing with this code before hitting that run button - that way you know what to anticipate and you train your brain to think in the way Python thinks when it sees your code. That way you train your brain to think and find solutions rather than finding easy way by clicking on hints/answers (remember - in real world, there won’t be any hints/answers). Then, when you do review correct answers/hints, it all sounds more like “Aha” moments rather than as another disappointment because you still do not get why their solution works and your’s does not.

To answer your side note, I doubt that you can seek for employment just from completing courses here. For actual employment, we need far more advanced skills and a lot pf practice. I would suggest that these courses here are intended to introduce you with necessary knowledge and skills needed to enter into advanced type of classes, which they do a great job since other platforms seem to be lacking that expertise at helping a novice to enter this new coding world. By more advanced classes I mean bootcamps or intensive courses that are available here where you really get equipped with necessary tools a programmer needs.

Hope this helps!

2 Likes

Yes, it’s difficult. Personally, I use pythontutor.com to visualize the “processing” of my code. I recommend also “Automate the boring stuff with python” pdf or video are great !

Hi everybody,

I tried these lines first:

def over_nine_thousand(lst):
  sum = 0
  for num in lst:
      sum += num
      if sum > 9000:
          return sum
          break
      elif lst == []:
          return 0

My question is: how to introduce sum <9000 because it stops every time the loop. May be some indentation solution? An idea?

Thanks

If you it makes you feel any better, I feel the same way about this particular coding challenge section in loops. I not had any similar problems in previous Codeacademy Python training, SQL nor Numpy.
Now this may be partly because I have no previous coding experience or because I sometimes have to spend a few days away to deal with other pieces of life and partly on Codeacademy’s weak areas in training. Probably is a combination of all above.
I do like to fill in SoloLearn app on my phone for internalizing basic concepts in Python. They teach in a different order and helps me to integrate the concepts.

I also have a question about solving these, alot of the time I know how to solve it when I think of in my head, but when it comes to writing it in code I never really know how to start. I have a pretty solid understanding of the concepts, it’s just that I struggle working on how to turn my thoughts into code.

Honestly, I felt like you at this point. I then returned back to the explanation unit!

I just gotta add something since I’ve been reading many people complaining about how Codecademy lessons never covered sum() or max() functions and so on. So I’ll try and make my reply here as short as I can, but informative and encouraging for anyone who never had experience coding, just like me :slight_smile:
If you feel like the lessons haven’t covered Python functions, you haven’t been paying attention! There’s a reason why every lesson has a link to Codecademy forums at the bottom. And after finishing a lesson I’ve NEVER moved on to the next lesson without checking the linked subject on the forum first. I read through everything and take notes. Don’t skip and don’t try to make this journey easier.
And ■■■■ yeah, the challenges are not easy for begginers. But again, they are called “challenge” for a reason, don’t you think? And they certainly live up to their name… on some of these I’ve spent days. Until I’ve run out of every possible combination my brain could think of, until I’ve completely run out of will and motivation to keep solving the problem, only then I’d check the solution. It happened three times so far. BUT I would never just leave after that. I would write down the entire problem so I can always return to it cause my brain will probably slip on a similar problem again in future and then I would study the code line by line until I’m 100% sure I understand every piece of it and what I was doing wrong.
Be resourceful just like you would in school or college, check everything Codecademy offers, google if need be but be sure to understand the process and what every piece of code does. It’s perfectly ok to be stuck on a problem and it’s ok to fail sometimes. As long as you learn from all of it, it can only benefit you.
Cheers Everyone and good luck :slight_smile:

1 Like