Should I keep trying to learn or will I never understand this?

You need to understand use cases for these concepts. If you need to do something more than once, or if you need to iterate through array or list entries etc ( like in #1 ) you need to write a loop. Think about it….. without the loop iterating forward, allowing you to repeat an action such as checking if an entry in a list is odd, you would write the same code over and over again and depending on the size of the seat or list, never write enough. Don’t think of a loop as a way to count to 10. It’s a way to start a process of repeating actions that start and stop based on parameters that you set.

For #2, again, let’s think about it. We want to take the word “hello” and stick it before names. These names are stored in a list…. There’s multiple names…you need to do the same thing over and over. Guess what man, you will do #1 and #2 at the same time, in the same loop if you want to. each time the loop iterates forward, grab that entry in the list, and set the entry = “hello “_concatenate the entry here ( I don’t know told language and don’t even know what one we’re talking about because it doesn’t even matter.

For #3 ….. I’ll leave this one to you, should be clear by now.

Think through the problems and find and understand the use cases for the concepts you learn. I’m self taught with no degree and have been a dev for 6 years now and run a team of 8. I worked my ass off and you’ll have to as well.

/r/learnprogramming Thread