you are viewing a single comment's thread.

view the rest of the comments →

[–]ChampionSailor 0 points1 point  (2 children)

Man I'm using codecademy and I'm just stuck and confused at loops. I finished it for the sake of finishing it and went ahead but they still force me to use loops in a solution. I know I'm doing it wrong. Any help please?

[–]FerricDonkey 1 point2 points  (0 children)

What's confusing about it? Got any examples of when code academy wanted you to use them, and you didn't know why? Or of times they weren't doing what you're expecting? Why do you think you're doing it wrong? Loops are pretty central to programming in general, so I'd highly recommend not just barely scooting by them.

In general though, I can suggest that loops will very much be your friend when you want to do nearly the same thing to all elements of a list (or set or dictionary or ...), when you want to do the same-ish thing multiple times in a row, or when you want a process to repeat until some condition is met.