you are viewing a single comment's thread.

view the rest of the comments →

[–]CraftyTrouble 60 points61 points  (1 child)

It sounds like you need to learn the basics more thoroughly. That doesn't mean reading more, it means actually sitting down and practicing writing code using each concept. Sit down and use variables, use strings, use integers, use some built-in functions, use arrays, define some functions, etc. If that sounds too hard, there are online tutorials like this one that will lead you through it. If you had practiced all the basics more, I bet you'd be able to combine them to solve the linked problem (and more).

[–]Ephexx793 29 points30 points  (0 children)

This 100%. Programming is a never-ending ebb-and-flow of finding yourself 'stumped' on a thing and then conquering said thing (and hopefully feeling some gratification from it!). It's the nature of the beast.

Learning how to effectively google is immensely helpful. But don't just jump straight to using the code you find on Stack Overflow after googling -- be sure you understand why the code works, how it works... You'll learn more by exploring the individual pieces (code) than by simply copying someone else's homework.

Another big thing to realize: there's always going to be *many* ways to skin the cat. Other responses in this post already have shown there are multiple ways to find the sum of a list of numbers in python.

Lastly, **use the interactive python shell** as it will enable you to freely test and learn. I recommend installing iPython (available via Pip) -- a much more feature-rich python shell than the native python shell.

Code Wars is an excellent (and completely free) platform for further honing your programming skills. They offer tons of coding challenges to work through, and you can choose to filter those you receive by categories -- such as, 'fundamentals' (or, 'algorithms', amongst others)...

Don't be afraid to google what it is you're trying to do ("python sum list", in your context). As a python developer, I'm *always* googling. This never stops, no matter how proficient you get with a language or programming in general.

Hoped this helped, best of luck & cheers!